Skip to content

Conversation

yuit
Copy link
Contributor

@yuit yuit commented May 5, 2016

Before calling lookAhead function check that the current toke is AsyncKeyword because lookAHead is an expensive operation

@RyanCavanaugh
Copy link
Member

Is there a bug tracking this?

@yuit
Copy link
Contributor Author

yuit commented May 5, 2016

@RyanCavanaugh nop it is from the PR @mhegazy made a comment after I merged the PR in

return parseSimpleArrowFunctionExpression(<Identifier>expr, asyncModifier);
// We do a check here so that we won't be doing unnecessarily call to "lookAhead"
if (token === SyntaxKind.AsyncKeyword) {
const isUnParenthesizedAsyncArrowFunction = lookAhead(isUnParenthesizedAsyncArrowFunctionWorker);
Copy link
Member

Choose a reason for hiding this comment

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

Linter's mad about the trailing WS here

@sandersn
Copy link
Member

sandersn commented May 5, 2016

👍

@yuit yuit merged commit 990f1c7 into master May 5, 2016
@yuit yuit deleted the checkbeforecalllookahead branch May 5, 2016 21:18
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 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.

4 participants