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

Unified Diff: src/scopes.cc

Issue 1240463002: [es6] Implement inner scope for functions with destructuring (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add tests for function name Created 5 years, 5 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/scopes.h ('k') | test/mjsunit/big-array-literal.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scopes.cc
diff --git a/src/scopes.cc b/src/scopes.cc
index d6a414b32050e2552b3405530fe323b0966e40e2..41622894a122d5a844788223bcc757f121585009 100644
--- a/src/scopes.cc
+++ b/src/scopes.cc
@@ -151,6 +151,9 @@ void Scope::SetDefaults(ScopeType scope_type, Scope* outer_scope,
FunctionKind function_kind) {
outer_scope_ = outer_scope;
scope_type_ = scope_type;
+ is_declaration_scope_ =
+ is_eval_scope() || is_function_scope() ||
+ is_module_scope() || is_script_scope();
function_kind_ = function_kind;
scope_name_ = ast_value_factory_->empty_string();
dynamics_ = nullptr;
@@ -1363,7 +1366,7 @@ bool Scope::HasArgumentsParameter(Isolate* isolate) {
void Scope::AllocateStackSlot(Variable* var) {
if (is_block_scope()) {
- DeclarationScope()->AllocateStackSlot(var);
+ outer_scope()->DeclarationScope()->AllocateStackSlot(var);
} else {
var->AllocateTo(VariableLocation::LOCAL, num_stack_slots_++);
}
« no previous file with comments | « src/scopes.h ('k') | test/mjsunit/big-array-literal.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698