| Index: src/preparser.h
|
| diff --git a/src/preparser.h b/src/preparser.h
|
| index 41b3a31f0e1169068eaf2968fe55b67fc3904ee4..195676084cfec785ce388e960c25722342b74c23 100644
|
| --- a/src/preparser.h
|
| +++ b/src/preparser.h
|
| @@ -117,7 +117,9 @@ class ParserBase : public Traits {
|
| bool allow_harmony_rest_params() const {
|
| return allow_harmony_rest_params_;
|
| }
|
| -
|
| + bool allow_harmony_exponentiation() const {
|
| + return scanner()->HarmonyExponentiation();
|
| + }
|
| bool allow_strong_mode() const { return allow_strong_mode_; }
|
|
|
| // Setters that determine whether certain syntactical constructs are
|
| @@ -157,6 +159,9 @@ class ParserBase : public Traits {
|
| void set_allow_harmony_rest_params(bool allow) {
|
| allow_harmony_rest_params_ = allow;
|
| }
|
| + void set_allow_harmony_exponentiation(bool allow) {
|
| + scanner()->SetHarmonyExponentiation(allow);
|
| + }
|
| void set_allow_strong_mode(bool allow) { allow_strong_mode_ = allow; }
|
|
|
| protected:
|
| @@ -2465,7 +2470,15 @@ ParserBase<Traits>::ParseBinaryExpression(int prec, bool accept_IN, bool* ok) {
|
| Token::Value op = Next();
|
| Scanner::Location op_location = scanner()->location();
|
| int pos = position();
|
| - ExpressionT y = ParseBinaryExpression(prec1 + 1, accept_IN, CHECK_OK);
|
| + ExpressionT y = Traits::EmptyExpression();
|
| +
|
| + if (op != Token::EXP) {
|
| + // Left-to-right associativity
|
| + y = ParseBinaryExpression(prec1 + 1, accept_IN, CHECK_OK);
|
| + } else {
|
| + // Right-to-left associativity
|
| + y = ParseBinaryExpression(prec1, accept_IN, CHECK_OK);
|
| + }
|
|
|
| if (this->ShortcutNumericLiteralBinaryExpression(&x, y, op, pos,
|
| factory())) {
|
|
|