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

Unified 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, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/parsing/parser.cc » ('j') | src/parsing/parser.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/scopes.h
diff --git a/src/ast/scopes.h b/src/ast/scopes.h
index e420cfe053ab4eb616020747c54d23f592715424..8c8a833168792ae3828ee344a5cd723948ec8fb6 100644
--- a/src/ast/scopes.h
+++ b/src/ast/scopes.h
@@ -490,6 +490,12 @@ class Scope: public ZoneObject {
// The ModuleDescriptor for this scope; only for module scopes.
ModuleDescriptor* module() const { return module_descriptor_; }
+ AstRawString* catch_variable_name() const {
+ DCHECK(is_catch_scope());
+ DCHECK(num_var_or_const() == 1);
+ return static_cast<AstRawString*>(variables_.Start()->key);
+ }
+
// ---------------------------------------------------------------------------
// Variable allocation.
« 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