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/base/hashmap.h" | 9 #include "src/base/hashmap.h" |
10 #include "src/globals.h" | 10 #include "src/globals.h" |
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 friend class DeclarationScope; | 580 friend class DeclarationScope; |
581 }; | 581 }; |
582 | 582 |
583 class DeclarationScope : public Scope { | 583 class DeclarationScope : public Scope { |
584 public: | 584 public: |
585 DeclarationScope(Zone* zone, Scope* outer_scope, ScopeType scope_type, | 585 DeclarationScope(Zone* zone, Scope* outer_scope, ScopeType scope_type, |
586 FunctionKind function_kind = kNormalFunction); | 586 FunctionKind function_kind = kNormalFunction); |
587 DeclarationScope(Zone* zone, ScopeType scope_type, | 587 DeclarationScope(Zone* zone, ScopeType scope_type, |
588 Handle<ScopeInfo> scope_info); | 588 Handle<ScopeInfo> scope_info); |
589 // Creates a script scope. | 589 // Creates a script scope. |
590 explicit DeclarationScope(Zone* zone); | 590 DeclarationScope(Zone* zone, AstValueFactory* ast_value_factory); |
591 | 591 |
592 bool IsDeclaredParameter(const AstRawString* name) { | 592 bool IsDeclaredParameter(const AstRawString* name) { |
593 // If IsSimpleParameterList is false, duplicate parameters are not allowed, | 593 // If IsSimpleParameterList is false, duplicate parameters are not allowed, |
594 // however `arguments` may be allowed if function is not strict code. Thus, | 594 // however `arguments` may be allowed if function is not strict code. Thus, |
595 // the assumptions explained above do not hold. | 595 // the assumptions explained above do not hold. |
596 return params_.Contains(variables_.Lookup(name)); | 596 return params_.Contains(variables_.Lookup(name)); |
597 } | 597 } |
598 | 598 |
599 FunctionKind function_kind() const { return function_kind_; } | 599 FunctionKind function_kind() const { return function_kind_; } |
600 | 600 |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
850 void AllocateModuleVariables(); | 850 void AllocateModuleVariables(); |
851 | 851 |
852 private: | 852 private: |
853 ModuleDescriptor* module_descriptor_; | 853 ModuleDescriptor* module_descriptor_; |
854 }; | 854 }; |
855 | 855 |
856 } // namespace internal | 856 } // namespace internal |
857 } // namespace v8 | 857 } // namespace v8 |
858 | 858 |
859 #endif // V8_AST_SCOPES_H_ | 859 #endif // V8_AST_SCOPES_H_ |
OLD | NEW |