Skip to content

Commit

Permalink
Fix binary precedence bug
Browse files Browse the repository at this point in the history
Signed-off-by: Seonghyun Kim <[email protected]>
  • Loading branch information
ksh8281 committed Sep 12, 2023
1 parent ef0aac9 commit c60e2c9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
36 changes: 18 additions & 18 deletions src/parser/esprima_cpp/esprima.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion test/vendortest

0 comments on commit c60e2c9

Please sign in to comment.