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

Unified Diff: src/parser.h

Issue 1318023004: Do not permit binding over catch parameters in for-of (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.h
diff --git a/src/parser.h b/src/parser.h
index effa562e2bc9d25862bd37e8d57ac6ae9f87ee57..9964e20d005e27d633989830116dba4b6983ae3f 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -1134,6 +1134,11 @@ class Parser : public ParserBase<ParserTraits> {
// hoisted over such a scope.
void CheckConflictingVarDeclarations(Scope* scope, bool* ok);
+ // Catch statements introduce some odd scoping constraints. You can't put a
+ // for-of statement that tries to bind to the same identifier as the
+ // CatchParameter, for example. (see B.3.5)
+ bool IsDeclaredAsCatchParameter(Scope* scope, const AstRawString* name);
+
// Parser support
VariableProxy* NewUnresolved(const AstRawString* name, VariableMode mode);
Variable* Declare(Declaration* declaration,
« no previous file with comments | « no previous file | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698