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

Unified Diff: src/parser.cc

Issue 1303013007: [es6] Remaining cases of parameter scopes for sloppy eval (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
« no previous file with comments | « src/parser.h ('k') | test/mjsunit/harmony/default-parameters.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 72967d6df43fd064f0a82943c61df55f7945656a..62eb76a793ed26c473b95fea4f7d98cfca652c6e 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -4365,7 +4365,7 @@ Block* Parser::BuildParameterInitializationBlock(
Scope* param_scope = scope_;
Block* param_block = init_block;
- if (parameter.initializer != nullptr && scope_->calls_sloppy_eval()) {
+ if (!parameter.is_simple() && scope_->calls_sloppy_eval()) {
param_scope = NewScope(scope_, BLOCK_SCOPE);
param_scope->set_is_declaration_scope();
param_scope->set_start_position(parameter.pattern->position());
@@ -4384,7 +4384,7 @@ Block* Parser::BuildParameterInitializationBlock(
&decl, nullptr, CHECK_OK);
}
- if (parameter.initializer != nullptr && scope_->calls_sloppy_eval()) {
+ if (!parameter.is_simple() && scope_->calls_sloppy_eval()) {
param_scope = param_scope->FinalizeBlockScope();
if (param_scope != nullptr) {
CheckConflictingVarDeclarations(param_scope, CHECK_OK);
Dan Ehrenberg 2015/08/25 20:18:12 Not new in this patch, but I'm wondering why we ch
rossberg 2015/08/25 21:58:40 Indeed, I did this with do-expressions in mind. Se
« no previous file with comments | « src/parser.h ('k') | test/mjsunit/harmony/default-parameters.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698