| 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 | 183 |
| 184 // --------------------------------------------------------------------------- | 184 // --------------------------------------------------------------------------- |
| 185 // Illegal redeclaration support. | 185 // Illegal redeclaration support. |
| 186 | 186 |
| 187 // Set an expression node that will be executed when the scope is | 187 // Set an expression node that will be executed when the scope is |
| 188 // entered. We only keep track of one illegal redeclaration node per | 188 // entered. We only keep track of one illegal redeclaration node per |
| 189 // scope - the first one - so if you try to set it multiple times | 189 // scope - the first one - so if you try to set it multiple times |
| 190 // the additional requests will be silently ignored. | 190 // the additional requests will be silently ignored. |
| 191 void SetIllegalRedeclaration(Expression* expression); | 191 void SetIllegalRedeclaration(Expression* expression); |
| 192 | 192 |
| 193 // Visit the illegal redeclaration expression. Do not call if the | 193 // Retrieve the illegal redeclaration expression. Do not call if the |
| 194 // scope doesn't have an illegal redeclaration node. | 194 // scope doesn't have an illegal redeclaration node. |
| 195 void VisitIllegalRedeclaration(AstVisitor* visitor); | 195 Expression* GetIllegalRedeclaration(); |
| 196 | 196 |
| 197 // Check if the scope has (at least) one illegal redeclaration. | 197 // Check if the scope has (at least) one illegal redeclaration. |
| 198 bool HasIllegalRedeclaration() const { return illegal_redecl_ != NULL; } | 198 bool HasIllegalRedeclaration() const { return illegal_redecl_ != NULL; } |
| 199 | 199 |
| 200 // For harmony block scoping mode: Check if the scope has conflicting var | 200 // For harmony block scoping mode: Check if the scope has conflicting var |
| 201 // declarations, i.e. a var declaration that has been hoisted from a nested | 201 // declarations, i.e. a var declaration that has been hoisted from a nested |
| 202 // scope over a let binding of the same name. | 202 // scope over a let binding of the same name. |
| 203 Declaration* CheckConflictingVarDeclarations(); | 203 Declaration* CheckConflictingVarDeclarations(); |
| 204 | 204 |
| 205 // --------------------------------------------------------------------------- | 205 // --------------------------------------------------------------------------- |
| (...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 793 PendingCompilationErrorHandler pending_error_handler_; | 793 PendingCompilationErrorHandler pending_error_handler_; |
| 794 | 794 |
| 795 // For tracking which classes are declared consecutively. Needed for strong | 795 // For tracking which classes are declared consecutively. Needed for strong |
| 796 // mode. | 796 // mode. |
| 797 int class_declaration_group_start_; | 797 int class_declaration_group_start_; |
| 798 }; | 798 }; |
| 799 | 799 |
| 800 } } // namespace v8::internal | 800 } } // namespace v8::internal |
| 801 | 801 |
| 802 #endif // V8_SCOPES_H_ | 802 #endif // V8_SCOPES_H_ |
| OLD | NEW |