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 return is_arrow_scope() ? nullptr : arguments_; | |
adamk
2015/04/09 15:56:03
Why is this necessary? Reading the code again, I d
adamk
2015/04/09 16:18:04
Sorry, I've been spending too much time in strict
arv (Not doing code reviews)
2015/04/09 16:53:07
Changing this to a DCHECK instead.
| |
399 } | |
398 | 400 |
399 // Declarations list. | 401 // Declarations list. |
400 ZoneList<Declaration*>* declarations() { return &decls_; } | 402 ZoneList<Declaration*>* declarations() { return &decls_; } |
401 | 403 |
402 // Inner scope list. | 404 // Inner scope list. |
403 ZoneList<Scope*>* inner_scopes() { return &inner_scopes_; } | 405 ZoneList<Scope*>* inner_scopes() { return &inner_scopes_; } |
404 | 406 |
405 // The scope immediately surrounding this scope, or NULL. | 407 // The scope immediately surrounding this scope, or NULL. |
406 Scope* outer_scope() const { return outer_scope_; } | 408 Scope* outer_scope() const { return outer_scope_; } |
407 | 409 |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
727 | 729 |
728 AstValueFactory* ast_value_factory_; | 730 AstValueFactory* ast_value_factory_; |
729 Zone* zone_; | 731 Zone* zone_; |
730 | 732 |
731 PendingCompilationErrorHandler pending_error_handler_; | 733 PendingCompilationErrorHandler pending_error_handler_; |
732 }; | 734 }; |
733 | 735 |
734 } } // namespace v8::internal | 736 } } // namespace v8::internal |
735 | 737 |
736 #endif // V8_SCOPES_H_ | 738 #endif // V8_SCOPES_H_ |
OLD | NEW |