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

Unified Diff: src/parser.cc

Issue 1397513004: Don't throw on assignment to function name binding in harmony sloppy mode (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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 | test/mjsunit/harmony/regress/regress-4482.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 7cf81c4f0569b0d770bf6751cc3f26a814a2a9aa..914e7b0b2837e37720fa2f54032148abda70e6d3 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -4716,12 +4716,9 @@ ZoneList<Statement*>* Parser::ParseEagerFunctionBody(
// NOTE: We create a proxy and resolve it here so that in the
// future we can change the AST to only refer to VariableProxies
// instead of Variables and Proxies as is the case now.
- Token::Value fvar_init_op = Token::INIT_CONST_LEGACY;
- bool use_strict_const = is_strict(scope_->language_mode()) ||
- (!allow_legacy_const() && allow_harmony_sloppy());
- if (use_strict_const) {
- fvar_init_op = Token::INIT_CONST;
- }
+ const bool use_strict_const = is_strict(scope_->language_mode());
+ Token::Value fvar_init_op =
+ use_strict_const ? Token::INIT_CONST : Token::INIT_CONST_LEGACY;
VariableMode fvar_mode = use_strict_const ? CONST : CONST_LEGACY;
Variable* fvar = new (zone())
Variable(scope_, function_name, fvar_mode, Variable::NORMAL,
« no previous file with comments | « no previous file | test/mjsunit/harmony/regress/regress-4482.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698