Chromium Code Reviews| Index: src/parser.h |
| diff --git a/src/parser.h b/src/parser.h |
| index 4bdf65957d57b6d70dfd63aabf4912154905baca..c9a77aa527c86c656f95fcad188da91db096053a 100644 |
| --- a/src/parser.h |
| +++ b/src/parser.h |
| @@ -448,6 +448,9 @@ class ParserTraits { |
| // Helper functions for recursive descent. |
| bool IsEvalOrArguments(Handle<String> identifier) const; |
| + // Returns true if the expression is of type "this.foo". |
| + static bool IsThisProperty(Expression* expression); |
| + |
| static bool IsBoilerplateProperty(ObjectLiteral::Property* property) { |
| return ObjectLiteral::IsBoilerplateProperty(property); |
| } |
| @@ -456,6 +459,8 @@ class ParserTraits { |
| return !string.is_null() && string->AsArrayIndex(index); |
| } |
| + // Functions for encapsulating the differences between parsing and preparsing; |
| + // operations interleaved with the recursive descent. |
| static void PushLiteralName(FuncNameInferrer* fni, Handle<String> id) { |
| fni->PushLiteralName(id); |
| } |
| @@ -469,6 +474,25 @@ class ParserTraits { |
| } |
| } |
| + // If we assign a function literal to a property we pretenure the |
| + // literal so it can be added as a constant function property. |
| + static void CheckAssigningFunctionLiteralToProperty(Expression* left, |
| + Expression* right); |
| + |
| + // Signal a reference error if the expression is an invalid left-hand side |
| + // expression. We could report this as a syntax error but for compatibility |
| + // with JSC we choose to report the error at runtime. |
|
rossberg
2014/03/13 09:25:34
Do we have plans to fix this eventually? It's clea
marja
2014/03/13 15:54:49
Wasn't on my radar (yet), but I'll put it on my TO
|
| + Expression* ValidateAssignmentLeftHandSide(Expression* expression) const; |
| + |
| + // Determine if the expression is a variable proxy and mark it as being used |
| + // in an assignment or with a increment/decrement operator. This is currently |
| + // used on for the statically checking assignments to harmony const bindings. |
| + static Expression* MarkExpressionAsLValue(Expression* expression); |
| + |
| + // Checks LHS expression for assignment and prefix/postfix increment/decrement |
| + // in strict mode. |
| + void CheckStrictModeLValue(Expression*expression, bool* ok); |
| + |
| // Reporting errors. |
| void ReportMessageAt(Scanner::Location source_location, |
| const char* message, |
| @@ -519,7 +543,6 @@ class ParserTraits { |
| } |
| // Temporary glue; these functions will move to ParserBase. |
| - Expression* ParseAssignmentExpression(bool accept_IN, bool* ok); |
| Expression* ParseV8Intrinsic(bool* ok); |
| FunctionLiteral* ParseFunctionLiteral( |
| Handle<String> name, |
| @@ -529,6 +552,8 @@ class ParserTraits { |
| int function_token_position, |
| FunctionLiteral::FunctionType type, |
| bool* ok); |
| + Expression* ParseYieldExpression(bool* ok); |
| + Expression* ParseConditionalExpression(bool accept_IN, bool* ok); |
| private: |
| Parser* parser_; |
| @@ -671,7 +696,6 @@ class Parser : public ParserBase<ParserTraits> { |
| // Support for hamony block scoped bindings. |
| Block* ParseScopedBlock(ZoneStringList* labels, bool* ok); |
| - Expression* ParseAssignmentExpression(bool accept_IN, bool* ok); |
| Expression* ParseYieldExpression(bool* ok); |
| Expression* ParseConditionalExpression(bool accept_IN, bool* ok); |
| Expression* ParseBinaryExpression(int prec, bool accept_IN, bool* ok); |
| @@ -707,15 +731,6 @@ class Parser : public ParserBase<ParserTraits> { |
| // Get odd-ball literals. |
| Literal* GetLiteralUndefined(int position); |
| - // Determine if the expression is a variable proxy and mark it as being used |
| - // in an assignment or with a increment/decrement operator. This is currently |
| - // used on for the statically checking assignments to harmony const bindings. |
| - void MarkAsLValue(Expression* expression); |
| - |
| - // Strict mode validation of LValue expressions |
| - void CheckStrictModeLValue(Expression* expression, |
| - bool* ok); |
| - |
| // For harmony block scoping mode: Check if the scope has conflicting var/let |
| // declarations from different scopes. It covers for example |
| // |