OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_PARSING_PREPARSER_H | 5 #ifndef V8_PARSING_PREPARSER_H |
6 #define V8_PARSING_PREPARSER_H | 6 #define V8_PARSING_PREPARSER_H |
7 | 7 |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/bailout-reason.h" | 9 #include "src/bailout-reason.h" |
10 #include "src/hashmap.h" | 10 #include "src/hashmap.h" |
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 // PreParser should not use FuncNameInferrer. | 685 // PreParser should not use FuncNameInferrer. |
686 UNREACHABLE(); | 686 UNREACHABLE(); |
687 } | 687 } |
688 | 688 |
689 static void CheckFunctionLiteralInsideTopLevelObjectLiteral( | 689 static void CheckFunctionLiteralInsideTopLevelObjectLiteral( |
690 Scope* scope, PreParserExpression property, bool* has_function) {} | 690 Scope* scope, PreParserExpression property, bool* has_function) {} |
691 | 691 |
692 static void CheckAssigningFunctionLiteralToProperty( | 692 static void CheckAssigningFunctionLiteralToProperty( |
693 PreParserExpression left, PreParserExpression right) {} | 693 PreParserExpression left, PreParserExpression right) {} |
694 | 694 |
695 static void CheckPossibleEvalCall(PreParserExpression expression, | |
696 Scope* scope) { | |
697 if (IsIdentifier(expression) && IsEval(AsIdentifier(expression))) { | |
698 scope->DeclarationScope()->RecordEvalCall(); | |
699 scope->RecordEvalCall(); | |
700 } | |
701 } | |
702 | |
703 static PreParserExpression MarkExpressionAsAssigned( | 695 static PreParserExpression MarkExpressionAsAssigned( |
704 PreParserExpression expression) { | 696 PreParserExpression expression) { |
705 // TODO(marja): To be able to produce the same errors, the preparser needs | 697 // TODO(marja): To be able to produce the same errors, the preparser needs |
706 // to start tracking which expressions are variables and which are assigned. | 698 // to start tracking which expressions are variables and which are assigned. |
707 return expression; | 699 return expression; |
708 } | 700 } |
709 | 701 |
710 bool ShortcutNumericLiteralBinaryExpression(PreParserExpression* x, | 702 bool ShortcutNumericLiteralBinaryExpression(PreParserExpression* x, |
711 PreParserExpression y, | 703 PreParserExpression y, |
712 Token::Value op, | 704 Token::Value op, |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1138 const PreParserFormalParameters& parameters, FunctionKind kind, | 1130 const PreParserFormalParameters& parameters, FunctionKind kind, |
1139 FunctionLiteral::FunctionType function_type, bool* ok) { | 1131 FunctionLiteral::FunctionType function_type, bool* ok) { |
1140 return pre_parser_->ParseEagerFunctionBody(function_name, pos, parameters, | 1132 return pre_parser_->ParseEagerFunctionBody(function_name, pos, parameters, |
1141 kind, function_type, ok); | 1133 kind, function_type, ok); |
1142 } | 1134 } |
1143 | 1135 |
1144 } // namespace internal | 1136 } // namespace internal |
1145 } // namespace v8 | 1137 } // namespace v8 |
1146 | 1138 |
1147 #endif // V8_PARSING_PREPARSER_H | 1139 #endif // V8_PARSING_PREPARSER_H |
OLD | NEW |