From c60e2c9c83214623a7786ed539e5c851b5fabf72 Mon Sep 17 00:00:00 2001 From: Seonghyun Kim Date: Mon, 11 Sep 2023 16:16:48 +0900 Subject: [PATCH] Fix binary precedence bug Signed-off-by: Seonghyun Kim --- src/parser/esprima_cpp/esprima.cpp | 36 +++++++++++++++--------------- test/vendortest | 2 +- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/parser/esprima_cpp/esprima.cpp b/src/parser/esprima_cpp/esprima.cpp index 6768ea385..eb7257f9d 100644 --- a/src/parser/esprima_cpp/esprima.cpp +++ b/src/parser/esprima_cpp/esprima.cpp @@ -3016,37 +3016,37 @@ class Parser { case LogicalAnd: return 3; case BitwiseOr: - return 3; - case BitwiseXor: return 4; - case BitwiseAnd: + case BitwiseXor: return 5; - case Equal: + case BitwiseAnd: return 6; + case Equal: + return 7; case NotEqual: - return 6; + return 7; case StrictEqual: - return 6; + return 7; case NotStrictEqual: - return 6; - case RightInequality: return 7; + case RightInequality: + return 8; case LeftInequality: - return 7; + return 8; case RightInequalityEqual: - return 7; + return 8; case LeftInequalityEqual: - return 7; - case LeftShift: return 8; + case LeftShift: + return 9; case RightShift: - return 8; + return 9; case UnsignedRightShift: - return 8; - case Plus: return 9; + case Plus: + return 10; case Minus: - return 9; + return 10; case Multiply: return 11; case Divide: @@ -3058,9 +3058,9 @@ class Parser { } } else if (token->type == Token::KeywordToken) { if (token->valueKeywordKind == InKeyword) { - return this->context->allowIn ? 7 : 0; + return this->context->allowIn ? 8 : 0; } else if (token->valueKeywordKind == InstanceofKeyword) { - return 7; + return 8; } } else { return 0; diff --git a/test/vendortest b/test/vendortest index 3fd4f94d2..524b0cb6c 160000 --- a/test/vendortest +++ b/test/vendortest @@ -1 +1 @@ -Subproject commit 3fd4f94d22ef5bfbba94b50afa601ae9abd253e5 +Subproject commit 524b0cb6c2536fc2ff9b08abf879a1f8d5f1f67d