Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: src/ast/scopes.h

Issue 2109733003: Add errors for declarations which conflict with catch parameters. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/parsing/parser.cc » ('j') | src/parsing/parser.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/pending-compilation-error-handler.h" 10 #include "src/pending-compilation-error-handler.h"
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 483
484 // Inner scope list. 484 // Inner scope list.
485 ZoneList<Scope*>* inner_scopes() { return &inner_scopes_; } 485 ZoneList<Scope*>* inner_scopes() { return &inner_scopes_; }
486 486
487 // The scope immediately surrounding this scope, or NULL. 487 // The scope immediately surrounding this scope, or NULL.
488 Scope* outer_scope() const { return outer_scope_; } 488 Scope* outer_scope() const { return outer_scope_; }
489 489
490 // The ModuleDescriptor for this scope; only for module scopes. 490 // The ModuleDescriptor for this scope; only for module scopes.
491 ModuleDescriptor* module() const { return module_descriptor_; } 491 ModuleDescriptor* module() const { return module_descriptor_; }
492 492
493 AstRawString* catch_variable_name() const {
494 DCHECK(is_catch_scope());
495 DCHECK(num_var_or_const() == 1);
496 return static_cast<AstRawString*>(variables_.Start()->key);
497 }
498
493 // --------------------------------------------------------------------------- 499 // ---------------------------------------------------------------------------
494 // Variable allocation. 500 // Variable allocation.
495 501
496 // Collect stack and context allocated local variables in this scope. Note 502 // Collect stack and context allocated local variables in this scope. Note
497 // that the function variable - if present - is not collected and should be 503 // that the function variable - if present - is not collected and should be
498 // handled separately. 504 // handled separately.
499 void CollectStackAndContextLocals(ZoneList<Variable*>* stack_locals, 505 void CollectStackAndContextLocals(ZoneList<Variable*>* stack_locals,
500 ZoneList<Variable*>* context_locals, 506 ZoneList<Variable*>* context_locals,
501 ZoneList<Variable*>* context_globals); 507 ZoneList<Variable*>* context_globals);
502 508
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 AstValueFactory* ast_value_factory_; 819 AstValueFactory* ast_value_factory_;
814 Zone* zone_; 820 Zone* zone_;
815 821
816 PendingCompilationErrorHandler pending_error_handler_; 822 PendingCompilationErrorHandler pending_error_handler_;
817 }; 823 };
818 824
819 } // namespace internal 825 } // namespace internal
820 } // namespace v8 826 } // namespace v8
821 827
822 #endif // V8_AST_SCOPES_H_ 828 #endif // V8_AST_SCOPES_H_
OLDNEW
« no previous file with comments | « no previous file | src/parsing/parser.cc » ('j') | src/parsing/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698