Skip to content

Commit

Permalink
perf: lookahead only when functionSent is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Aug 29, 2019
1 parent ee6d6e4 commit 34bd654
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/babel-parser/src/parser/statement.js
Expand Up @@ -167,7 +167,12 @@ export default class StatementParser extends ExpressionParser {
case tt._for:
return this.parseForStatement(node);
case tt._function:
if (this.lookaheadCharCode() === charCodes.dot) break;
if (
this.hasPlugin("functionSent") &&
this.lookaheadCharCode() === charCodes.dot
) {
break;
}
if (context) {
if (this.state.strict) {
this.raise(
Expand Down

0 comments on commit 34bd654

Please sign in to comment.