Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 2 commits into from

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.

None yet

3 participants