Move emit helper flags to binder.#6495
Merged
Merged
Conversation
Member
There was a problem hiding this comment.
Instead of this, what if you just looked for await expressions? Technically you don't need an await helper unless you use await right?
Contributor
Author
There was a problem hiding this comment.
I need the helper for any async function, even if it does not have an await.
Contributor
Author
|
@DanielRosenwasser any further comments? @mhegazy, @RyanCavanaugh any comments? |
Member
There was a problem hiding this comment.
Consider writing a nodeIsDecoratedCorrectly
Contributor
Author
There was a problem hiding this comment.
While I'm not keen on the proposed name, I think I will clean up the nodeIsDecorated function, as it can rely on nodeCanBeDecorated.
Member
|
👍 |
rbuckton
added a commit
that referenced
this pull request
Jan 21, 2016
Move emit helper flags to binder.
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When investigating #6113 I found the issue also is also reproducible for
__extendsand other emit helpers.Previously, when we check a source file we use scoped variables (
emitExtends,emitAwaiter, etc.) in the checker that we reset before checking each source file. However, during the widening of object literals we check the object literal expression, which can then in turn check function expression bodies or object literal method bodies. When the function or method body contains a reference to a method defined in a different file, it both triggers the same checks as above, but for the wrong source file. By the time the checker gets to the source file, the expression's type has been cached. As a result, the expression is not rechecked and the triggers to set the scoped variables are never fired for the file.Since we are guaranteed to do a full walk of one file at a time in the binder, I've moved these checks for our various emit helpers there.