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

Fix canvas getContext signature in lib/lib.dom.d.ts #15498

Closed
wants to merge 1 commit into from

Conversation

bbenezech
Copy link

According to
https://developer.mozilla.org/en/docs/Web/API/HTMLCanvasElement/getConte
xt, it only returns null if the context identifier is not supported
(i.e. not “2d” | "webgl" | "experimental-webgl”, when new non-standard
renderers are omitted).

It used to be that way, but was changed part of this (huge) commit, 1c9df84
I cannot find the originating commit in the PR: #9697 but it must be somewhere (my git skills are average).

This fix might make some people happy: this error generates tons of
useless and annoying non-null ! type casts when working with canvases.

  • There is an associated issue that is labelled
    'Bug' or 'Accepting PRs' or is in the Community milestone
  • Code is up-to-date with the master branch
  • You've successfully run jake runtests locally
  • You've signed the CLA
  • There are new or updated unit tests validating the change

According to
https://developer.mozilla.org/en/docs/Web/API/HTMLCanvasElement/getConte
xt, it only returns `null if the context identifier is not supported`
(i.e. not “2d” | "webgl" | "experimental-webgl”, when new non-standard
renderers are omitted).

This fix might make some people happy: this error generates tons of
useless and annoying non-null `!` type casts when working with canvases.
@msftclas
Copy link

msftclas commented May 1, 2017

@bbenezech,
Thanks for having already signed the Contribution License Agreement. Your agreement has not been validated yet. We will now review your pull request.
Thanks,
Microsoft Pull Request Bot

@mhegazy
Copy link
Contributor

mhegazy commented May 1, 2017

Thanks for your PR. these files are not manually edited, they are auto-generatd from a script in . You can find more information about contributing lib.d.ts fixes at https://github.com/Microsoft/TSJS-lib-generator.

Changes should be done in https://github.com/Microsoft/TSJS-lib-generator instead.

Please find more information at: https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md#contributing-libdts-fixes.

For future references, please file an issue first to track changes.

@mhegazy mhegazy closed this May 1, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants