Skip to content

Fixes #120: CancellationToken.is does not check for undefined#121

Closed
siegebell wants to merge 2 commits intomicrosoft:masterfrom
siegebell:master
Closed

Fixes #120: CancellationToken.is does not check for undefined#121
siegebell wants to merge 2 commits intomicrosoft:masterfrom
siegebell:master

Conversation

@siegebell
Copy link

No description provided.

@msftclas
Copy link

msftclas commented Nov 9, 2016

Hi @siegebell, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!

This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. Real humans will now evaluate your PR.

TTYL, MSBOT;

@msftclas
Copy link

msftclas commented Nov 9, 2016

Hi @siegebell, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!

This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. Real humans will now evaluate your PR.

TTYL, MSBOT;

@dbaeumer
Copy link
Member

This is already fix in master using the following code:

	export function is(value: any): value is CancellationToken {
		let candidate = value as CancellationToken;
		return candidate && (candidate === CancellationToken.None
			|| candidate === CancellationToken.Cancelled
			|| (Is.boolean(candidate.isCancellationRequested) && Is.defined(candidate.onCancellationRequested)));
	}

@dbaeumer
Copy link
Member

Thanks for the test case which I merged in by hand.

@dbaeumer dbaeumer closed this Nov 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants