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

Unified Diff: src/parsing/parser.cc

Issue 2290753003: Allow lexically declared "arguments" in function scope in sloppy mode. (Closed)
Patch Set: clang format Created 4 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 | « src/ast/scopes.cc ('k') | test/cctest/interpreter/bytecode_expectations/CallLookupSlot.golden » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser.cc
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc
index aeef16bb6a34c7b0ad671fd5355d2bcc0c62dfff..56e2a920317f60a4b2821d99e8bf61aaaa76c018 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -4010,6 +4010,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.
« no previous file with comments | « src/ast/scopes.cc ('k') | test/cctest/interpreter/bytecode_expectations/CallLookupSlot.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698