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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 return rest_index_ >= 0; | 387 return rest_index_ >= 0; |
388 } | 388 } |
389 | 389 |
390 bool is_simple_parameter_list() const { | 390 bool is_simple_parameter_list() const { |
391 DCHECK(is_function_scope()); | 391 DCHECK(is_function_scope()); |
392 if (rest_index_ >= 0) return false; | 392 if (rest_index_ >= 0) return false; |
393 return true; | 393 return true; |
394 } | 394 } |
395 | 395 |
396 // The local variable 'arguments' if we need to allocate it; NULL otherwise. | 396 // The local variable 'arguments' if we need to allocate it; NULL otherwise. |
397 Variable* arguments() const { return arguments_; } | 397 Variable* arguments() const { |
| 398 DCHECK(!is_arrow_scope() || arguments_ == nullptr); |
| 399 return arguments_; |
| 400 } |
398 | 401 |
399 // Declarations list. | 402 // Declarations list. |
400 ZoneList<Declaration*>* declarations() { return &decls_; } | 403 ZoneList<Declaration*>* declarations() { return &decls_; } |
401 | 404 |
402 // Inner scope list. | 405 // Inner scope list. |
403 ZoneList<Scope*>* inner_scopes() { return &inner_scopes_; } | 406 ZoneList<Scope*>* inner_scopes() { return &inner_scopes_; } |
404 | 407 |
405 // The scope immediately surrounding this scope, or NULL. | 408 // The scope immediately surrounding this scope, or NULL. |
406 Scope* outer_scope() const { return outer_scope_; } | 409 Scope* outer_scope() const { return outer_scope_; } |
407 | 410 |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
727 | 730 |
728 AstValueFactory* ast_value_factory_; | 731 AstValueFactory* ast_value_factory_; |
729 Zone* zone_; | 732 Zone* zone_; |
730 | 733 |
731 PendingCompilationErrorHandler pending_error_handler_; | 734 PendingCompilationErrorHandler pending_error_handler_; |
732 }; | 735 }; |
733 | 736 |
734 } } // namespace v8::internal | 737 } } // namespace v8::internal |
735 | 738 |
736 #endif // V8_SCOPES_H_ | 739 #endif // V8_SCOPES_H_ |
OLD | NEW |