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

Annotate Polymer function with @global. #4967

Merged
merged 1 commit into from
Nov 30, 2017
Merged

Conversation

aomarks
Copy link
Member

@aomarks aomarks commented Nov 30, 2017

This will let Analyzer discover it thanks to
Polymer/polymer-analyzer#774.
@TimvdLippe
Copy link
Contributor

I am okay with an extra annotation, but it leaves me wondering why detecting an assignment starting with window. wouldn't work. Is that because the polymerFn is used instead of Polymer?

@aomarks
Copy link
Member Author

aomarks commented Nov 30, 2017

Our approach in analyzer has so far generally been to just follow the @memberof annotations, rather than trying to understand the LHS of the assignment expression. If a function doesn't have @memberof, it would be totally ignored. So I just extended this to also respect @global, since @memberof window was a bit weird (see Polymer/polymer-analyzer#774). I guess we could have had special handling for window instead, this was just simpler to do. Note it is a JSDoc thing: http://usejsdoc.org/tags-global.html.

@aomarks aomarks merged commit b124b70 into master Nov 30, 2017
@aomarks aomarks deleted the annotate-polymer-fn branch November 30, 2017 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants