-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Async Functions for ES6 #3078
Async Functions for ES6 #3078
Conversation
} | ||
|
||
function doOutsideOfContext<T>(context: ParserContextFlags, func: () => T): T { | ||
let setContextFlags = context & contextFlags; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'setContextFlags' is not a great name (esp as we have a function call setContextFlag). Maybe 'newContextFlags'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setContextFlags
-> contextFlagsToClear
unsetContextFlags
-> contextFlagsToSet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
fillSignature(SyntaxKind.ColonToken, /*yieldAndGeneratorParameterContext*/ !!node.asteriskToken, /*requireCompleteParameterList*/ false, node); | ||
node.body = parseFunctionBlockOrSemicolon(!!node.asteriskToken, Diagnostics.or_expected); | ||
let isGenerator = !!node.asteriskToken; | ||
let isAsync = isAsyncFunctionLike(node); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here.
Adds support for async functions when targeting ES6 only.