From 5cae58d0a1fe5cc12e1c338315bba86ca6141183 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Thu, 2 Feb 2023 14:36:36 -0500 Subject: [PATCH] exit early when identifier is a reserved word --- packages/babel-parser/src/parser/expression.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/babel-parser/src/parser/expression.ts b/packages/babel-parser/src/parser/expression.ts index 6590a5119d13..ff10ce7374fc 100644 --- a/packages/babel-parser/src/parser/expression.ts +++ b/packages/babel-parser/src/parser/expression.ts @@ -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 });