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_AST_SCOPES_H_ | 5 #ifndef V8_AST_SCOPES_H_ |
6 #define V8_AST_SCOPES_H_ | 6 #define V8_AST_SCOPES_H_ |
7 | 7 |
8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
9 #include "src/hashmap.h" | 9 #include "src/hashmap.h" |
10 #include "src/pending-compilation-error-handler.h" | 10 #include "src/pending-compilation-error-handler.h" |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 void RecordEvalCall() { scope_calls_eval_ = true; } | 236 void RecordEvalCall() { scope_calls_eval_ = true; } |
237 | 237 |
238 // Inform the scope that the corresponding code uses "arguments". | 238 // Inform the scope that the corresponding code uses "arguments". |
239 void RecordArgumentsUsage() { scope_uses_arguments_ = true; } | 239 void RecordArgumentsUsage() { scope_uses_arguments_ = true; } |
240 | 240 |
241 // Inform the scope that the corresponding code uses "super". | 241 // Inform the scope that the corresponding code uses "super". |
242 void RecordSuperPropertyUsage() { scope_uses_super_property_ = true; } | 242 void RecordSuperPropertyUsage() { scope_uses_super_property_ = true; } |
243 | 243 |
244 // Set the language mode flag (unless disabled by a global flag). | 244 // Set the language mode flag (unless disabled by a global flag). |
245 void SetLanguageMode(LanguageMode language_mode) { | 245 void SetLanguageMode(LanguageMode language_mode) { |
246 DCHECK(!is_module_scope()); | 246 DCHECK(!is_module_scope() || is_strict(language_mode)); |
247 language_mode_ = language_mode; | 247 language_mode_ = language_mode; |
248 } | 248 } |
249 | 249 |
250 // Set the ASM module flag. | 250 // Set the ASM module flag. |
251 void SetAsmModule() { asm_module_ = true; } | 251 void SetAsmModule() { asm_module_ = true; } |
252 | 252 |
253 // Inform the scope that the scope may execute declarations nonlinearly. | 253 // Inform the scope that the scope may execute declarations nonlinearly. |
254 // Currently, the only nonlinear scope is a switch statement. The name is | 254 // Currently, the only nonlinear scope is a switch statement. The name is |
255 // more general in case something else comes up with similar control flow, | 255 // more general in case something else comes up with similar control flow, |
256 // for example the ability to break out of something which does not have | 256 // for example the ability to break out of something which does not have |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 AstValueFactory* ast_value_factory_; | 810 AstValueFactory* ast_value_factory_; |
811 Zone* zone_; | 811 Zone* zone_; |
812 | 812 |
813 PendingCompilationErrorHandler pending_error_handler_; | 813 PendingCompilationErrorHandler pending_error_handler_; |
814 }; | 814 }; |
815 | 815 |
816 } // namespace internal | 816 } // namespace internal |
817 } // namespace v8 | 817 } // namespace v8 |
818 | 818 |
819 #endif // V8_AST_SCOPES_H_ | 819 #endif // V8_AST_SCOPES_H_ |
OLD | NEW |