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

Unified Diff: src/scopes.h

Issue 924403002: [parsing]: eval/arguments parameter names are ok in sloppy mode (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: test fix Created 5 years, 10 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 | « src/preparser.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scopes.h
diff --git a/src/scopes.h b/src/scopes.h
index 56a7ee97657148e430de38d8344f37cb5d2ec4cf..c3f4f8e2661eb3cade34529ba6df9fa9f8aa14f9 100644
--- a/src/scopes.h
+++ b/src/scopes.h
@@ -467,6 +467,13 @@ class Scope: public ZoneObject {
return variables_.Lookup(name) != NULL;
}
+ bool IsDeclaredParameter(const AstRawString* name) {
+ // If IsSimpleParameterList is false, duplicate parameters are not allowed,
+ // however `arguments` may be allowed if function is not strict code. Thus,
+ // the assumptions explained above do not hold.
+ return params_.Contains(variables_.Lookup(name));
+ }
+
// ---------------------------------------------------------------------------
// Debugging.
« no previous file with comments | « src/preparser.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698