Skip to content

Commit

Permalink
exit early when identifier is a reserved word
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Feb 2, 2023
1 parent 037e8c6 commit 5cae58d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/babel-parser/src/parser/expression.ts
Expand Up @@ -2812,6 +2812,7 @@ export default abstract class ExpressionParser extends LValParser {
at: startLoc,
reservedWord: word,
});
return;
} else if (word === "yield") {
if (this.prodParam.hasYield) {
this.raise(Errors.YieldBindingIdentifier, { at: startLoc });
Expand Down

0 comments on commit 5cae58d

Please sign in to comment.