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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 bool is_function_scope() const { | 272 bool is_function_scope() const { |
273 return scope_type_ == FUNCTION_SCOPE || scope_type_ == ARROW_SCOPE; | 273 return scope_type_ == FUNCTION_SCOPE || scope_type_ == ARROW_SCOPE; |
274 } | 274 } |
275 bool is_module_scope() const { return scope_type_ == MODULE_SCOPE; } | 275 bool is_module_scope() const { return scope_type_ == MODULE_SCOPE; } |
276 bool is_script_scope() const { return scope_type_ == SCRIPT_SCOPE; } | 276 bool is_script_scope() const { return scope_type_ == SCRIPT_SCOPE; } |
277 bool is_catch_scope() const { return scope_type_ == CATCH_SCOPE; } | 277 bool is_catch_scope() const { return scope_type_ == CATCH_SCOPE; } |
278 bool is_block_scope() const { return scope_type_ == BLOCK_SCOPE; } | 278 bool is_block_scope() const { return scope_type_ == BLOCK_SCOPE; } |
279 bool is_with_scope() const { return scope_type_ == WITH_SCOPE; } | 279 bool is_with_scope() const { return scope_type_ == WITH_SCOPE; } |
280 bool is_arrow_scope() const { return scope_type_ == ARROW_SCOPE; } | 280 bool is_arrow_scope() const { return scope_type_ == ARROW_SCOPE; } |
281 bool is_declaration_scope() const { return is_declaration_scope_; } | 281 bool is_declaration_scope() const { return is_declaration_scope_; } |
282 bool is_strict_eval_scope() const { | |
283 return is_eval_scope() && is_strict(language_mode_); | |
284 } | |
285 | 282 |
286 void set_is_declaration_scope() { is_declaration_scope_ = true; } | 283 void set_is_declaration_scope() { is_declaration_scope_ = true; } |
287 | 284 |
288 // Information about which scopes calls eval. | 285 // Information about which scopes calls eval. |
289 bool calls_eval() const { return scope_calls_eval_; } | 286 bool calls_eval() const { return scope_calls_eval_; } |
290 bool calls_sloppy_eval() { | 287 bool calls_sloppy_eval() { |
291 return scope_calls_eval_ && is_sloppy(language_mode_); | 288 return scope_calls_eval_ && is_sloppy(language_mode_); |
292 } | 289 } |
293 bool outer_scope_calls_sloppy_eval() const { | 290 bool outer_scope_calls_sloppy_eval() const { |
294 return outer_scope_calls_sloppy_eval_; | 291 return outer_scope_calls_sloppy_eval_; |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 PendingCompilationErrorHandler pending_error_handler_; | 762 PendingCompilationErrorHandler pending_error_handler_; |
766 | 763 |
767 // For tracking which classes are declared consecutively. Needed for strong | 764 // For tracking which classes are declared consecutively. Needed for strong |
768 // mode. | 765 // mode. |
769 int class_declaration_group_start_; | 766 int class_declaration_group_start_; |
770 }; | 767 }; |
771 | 768 |
772 } } // namespace v8::internal | 769 } } // namespace v8::internal |
773 | 770 |
774 #endif // V8_SCOPES_H_ | 771 #endif // V8_SCOPES_H_ |
OLD | NEW |