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

Hint when invoking getContext instead of context2D #18862

Closed
bwilkerson opened this issue May 16, 2014 · 5 comments
Closed

Hint when invoking getContext instead of context2D #18862

bwilkerson opened this issue May 16, 2014 · 5 comments
Labels
analyzer-warning Issues with the analyzer's Warning codes area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug

Comments

@bwilkerson
Copy link
Member

It is more efficient to invoke the getter 'context2D' than it is to invoke the method 'getContext' with an argument of '2d'. We should have a hint to let people know.

See https://codereview.chromium.org/286273003/ for code that adds related knowledge to type propagation.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the Later milestone.
Added Oldschool-Milestone-Later label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-Later label.

@bwilkerson bwilkerson added Type-Enhancement area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. analyzer-warning Issues with the analyzer's Warning codes labels Aug 4, 2014
@kevmoo kevmoo added P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug and removed triaged labels Mar 1, 2016
@srawlins
Copy link
Member

srawlins commented Oct 9, 2023

WDYT Brian, is this still worth a diagnostic, or maybe leave for an analyzer plugin (er, future plugin)?

@bwilkerson
Copy link
Member Author

There might still be browsers around for which this is true, and I'm not sure we want to make our users wait until we have plugins, so maybe we should leave this open for now. :-)

@parlough
Copy link
Member

parlough commented Oct 9, 2023

I think it's not worth it considering package:web, which at least as of right now uses just uses getContext anyway: https://github.com/dart-lang/web/blob/c786d745a99177dda073cb75d98a4fba95a68a86/lib/src/helpers/extensions.dart#L30-L31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-warning Issues with the analyzer's Warning codes area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

5 participants