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

Unified Diff: src/parsing/parser.cc

Issue 2290753003: Allow lexically declared "arguments" in function scope in sloppy mode. (Closed)
Patch Set: update Created 4 years, 4 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
Index: src/parsing/parser.cc
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc
index e978f0b6b4ed311c5c55229dbe4ce41f31b12b88..2fdd9db5b0cf71dd3d504414b96d795dfe39f47e 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -4019,6 +4019,10 @@ FunctionLiteral* Parser::ParseFunctionLiteral(
// Parsing the body may change the language mode in our scope.
language_mode = scope->language_mode();
+ scope->DeclareArguments(ast_value_factory());
+ if (main_scope != scope) {
+ main_scope->DeclareArguments(ast_value_factory());
+ }
// Validate name and parameter names. We can do this only after parsing the
// function, since the function can declare itself strict.

Powered by Google App Engine
This is Rietveld 408576698