| 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_SCOPES_H_ | 5 #ifndef V8_SCOPES_H_ |
| 6 #define V8_SCOPES_H_ | 6 #define V8_SCOPES_H_ |
| 7 | 7 |
| 8 #include "src/ast.h" | 8 #include "src/ast.h" |
| 9 #include "src/pending-compilation-error-handler.h" | 9 #include "src/pending-compilation-error-handler.h" |
| 10 #include "src/zone.h" | 10 #include "src/zone.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 // outer scope. Only possible for function scopes; at most one variable. | 118 // outer scope. Only possible for function scopes; at most one variable. |
| 119 void DeclareFunctionVar(VariableDeclaration* declaration) { | 119 void DeclareFunctionVar(VariableDeclaration* declaration) { |
| 120 DCHECK(is_function_scope()); | 120 DCHECK(is_function_scope()); |
| 121 function_ = declaration; | 121 function_ = declaration; |
| 122 } | 122 } |
| 123 | 123 |
| 124 // Declare a parameter in this scope. When there are duplicated | 124 // Declare a parameter in this scope. When there are duplicated |
| 125 // parameters the rightmost one 'wins'. However, the implementation | 125 // parameters the rightmost one 'wins'. However, the implementation |
| 126 // expects all parameters to be declared and from left to right. | 126 // expects all parameters to be declared and from left to right. |
| 127 Variable* DeclareParameter(const AstRawString* name, VariableMode mode, | 127 Variable* DeclareParameter(const AstRawString* name, VariableMode mode, |
| 128 bool is_rest = false); | 128 bool is_rest, bool* is_duplicate); |
| 129 | 129 |
| 130 // Declare a local variable in this scope. If the variable has been | 130 // Declare a local variable in this scope. If the variable has been |
| 131 // declared before, the previously declared variable is returned. | 131 // declared before, the previously declared variable is returned. |
| 132 Variable* DeclareLocal(const AstRawString* name, VariableMode mode, | 132 Variable* DeclareLocal(const AstRawString* name, VariableMode mode, |
| 133 InitializationFlag init_flag, Variable::Kind kind, | 133 InitializationFlag init_flag, Variable::Kind kind, |
| 134 MaybeAssignedFlag maybe_assigned_flag = kNotAssigned); | 134 MaybeAssignedFlag maybe_assigned_flag = kNotAssigned); |
| 135 | 135 |
| 136 // Declare an implicit global variable in this scope which must be a | 136 // Declare an implicit global variable in this scope which must be a |
| 137 // script scope. The variable was introduced (possibly from an inner | 137 // script scope. The variable was introduced (possibly from an inner |
| 138 // scope) by a reference to an unresolved variable with no intervening | 138 // scope) by a reference to an unresolved variable with no intervening |
| (...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 | 730 |
| 731 AstValueFactory* ast_value_factory_; | 731 AstValueFactory* ast_value_factory_; |
| 732 Zone* zone_; | 732 Zone* zone_; |
| 733 | 733 |
| 734 PendingCompilationErrorHandler pending_error_handler_; | 734 PendingCompilationErrorHandler pending_error_handler_; |
| 735 }; | 735 }; |
| 736 | 736 |
| 737 } } // namespace v8::internal | 737 } } // namespace v8::internal |
| 738 | 738 |
| 739 #endif // V8_SCOPES_H_ | 739 #endif // V8_SCOPES_H_ |
| OLD | NEW |