Skip to content

Handle binding elements while looking for invalid await and yield#19972

Merged
weswigham merged 3 commits into
microsoft:masterfrom
weswigham:mark-async-yield-in-binding-initializer-error
Nov 14, 2017
Merged

Handle binding elements while looking for invalid await and yield#19972
weswigham merged 3 commits into
microsoft:masterfrom
weswigham:mark-async-yield-in-binding-initializer-error

Conversation

@weswigham
Copy link
Copy Markdown
Member

@weswigham weswigham commented Nov 13, 2017

Also, handle omitting a node in the visitor passed into addCustomPrologue, fixing part of #19967, and account for binding elements in isInParameterInitializerBeforeContainingFunction, fixing #18981 and #19967.

Fixes #18981, #19967

…nts in isInParameterInitializerBeforeContainingFunction
Comment thread src/compiler/factory.ts Outdated
let statement = source[statementOffset];
if (getEmitFlags(statement) & EmitFlags.CustomPrologue) {
target.push(visitor ? visitNode(statement, visitor, isStatement) : statement);
if (visitor) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

append checks if the value is undefined, so this could be written as:

append(target, visitor ? visitNode(statement, visitor, isStatement) : statement);

@weswigham weswigham merged commit 3d60293 into microsoft:master Nov 14, 2017
@weswigham weswigham deleted the mark-async-yield-in-binding-initializer-error branch November 14, 2017 00:40
@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.

Await is allowed in object shorthand initializers in parameters

3 participants