From 93017a2fca1e805cd77e3ccadb48711b83ed0013 Mon Sep 17 00:00:00 2001 From: Yuri Papouski Date: Fri, 24 May 2024 05:09:55 +0000 Subject: [PATCH] Remove bitwise AND from check as it unneeded --- dist/meriyah.umd.js | 4 +--- src/parser.ts | 6 +----- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/dist/meriyah.umd.js b/dist/meriyah.umd.js index 9b4d041..aec7f16 100644 --- a/dist/meriyah.umd.js +++ b/dist/meriyah.umd.js @@ -6315,9 +6315,7 @@ switch (parser.token) { case 67108877: { nextToken(parser, (context | 1073741824 | 8192) ^ 8192); - if (context & 16384 && - (parser.token & 131) === 131 && - parser.tokenValue === 'super') { + if (context & 16384 && parser.token === 131 && parser.tokenValue === 'super') { report(parser, 27); } parser.assignable = 1; diff --git a/src/parser.ts b/src/parser.ts index 6cad6e2..c4faa15 100644 --- a/src/parser.ts +++ b/src/parser.ts @@ -4045,11 +4045,7 @@ export function parseMemberOrUpdateExpression( case Token.Period: { nextToken(parser, (context | Context.AllowEscapedKeyword | Context.InGlobal) ^ Context.InGlobal); - if ( - context & Context.InClass && - (parser.token & Token.PrivateField) === Token.PrivateField && - parser.tokenValue === 'super' - ) { + if (context & Context.InClass && parser.token === Token.PrivateField && parser.tokenValue === 'super') { report(parser, Errors.InvalidSuperProperty); }