Chromium Code Reviews| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 121 DCHECK(is_function_scope()); | 121 DCHECK(is_function_scope()); |
| 122 // Handle implicit declaration of the function name in named function | 122 // Handle implicit declaration of the function name in named function |
| 123 // expressions before other declarations. | 123 // expressions before other declarations. |
| 124 decls_.InsertAt(0, declaration, zone()); | 124 decls_.InsertAt(0, declaration, zone()); |
| 125 function_ = declaration; | 125 function_ = declaration; |
| 126 } | 126 } |
| 127 | 127 |
| 128 // Declare a parameter in this scope. When there are duplicated | 128 // Declare a parameter in this scope. When there are duplicated |
| 129 // parameters the rightmost one 'wins'. However, the implementation | 129 // parameters the rightmost one 'wins'. However, the implementation |
| 130 // expects all parameters to be declared and from left to right. | 130 // expects all parameters to be declared and from left to right. |
| 131 Variable* DeclareParameter( | 131 Variable* DeclareParameter(const AstRawString* name, VariableMode mode, |
| 132 const AstRawString* name, VariableMode mode, | 132 bool is_optional, bool is_rest, |
|
Benedikt Meurer
2015/08/27 04:34:51
Also undo this change.
gdeepti
2015/08/27 18:49:17
Done.
| |
| 133 bool is_optional, bool is_rest, bool* is_duplicate); | 133 bool* is_duplicate); |
| 134 | 134 |
| 135 // Declare a local variable in this scope. If the variable has been | 135 // Declare a local variable in this scope. If the variable has been |
| 136 // declared before, the previously declared variable is returned. | 136 // declared before, the previously declared variable is returned. |
| 137 Variable* DeclareLocal(const AstRawString* name, VariableMode mode, | 137 Variable* DeclareLocal(const AstRawString* name, VariableMode mode, |
| 138 InitializationFlag init_flag, Variable::Kind kind, | 138 InitializationFlag init_flag, Variable::Kind kind, |
| 139 MaybeAssignedFlag maybe_assigned_flag = kNotAssigned, | 139 MaybeAssignedFlag maybe_assigned_flag = kNotAssigned, |
| 140 int declaration_group_start = -1); | 140 int declaration_group_start = -1); |
| 141 | 141 |
| 142 // Declare an implicit global variable in this scope which must be a | 142 // Declare an implicit global variable in this scope which must be a |
| 143 // script scope. The variable was introduced (possibly from an inner | 143 // script scope. The variable was introduced (possibly from an inner |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 778 PendingCompilationErrorHandler pending_error_handler_; | 778 PendingCompilationErrorHandler pending_error_handler_; |
| 779 | 779 |
| 780 // For tracking which classes are declared consecutively. Needed for strong | 780 // For tracking which classes are declared consecutively. Needed for strong |
| 781 // mode. | 781 // mode. |
| 782 int class_declaration_group_start_; | 782 int class_declaration_group_start_; |
| 783 }; | 783 }; |
| 784 | 784 |
| 785 } } // namespace v8::internal | 785 } } // namespace v8::internal |
| 786 | 786 |
| 787 #endif // V8_SCOPES_H_ | 787 #endif // V8_SCOPES_H_ |
| OLD | NEW |