Index: src/ast/scopes.cc |
diff --git a/src/ast/scopes.cc b/src/ast/scopes.cc |
index 376fbc532af2e848365ba5d822bde2f01ea20ab7..322f801317c3b09a5373dbfe153f94aabe1d5eaf 100644 |
--- a/src/ast/scopes.cc |
+++ b/src/ast/scopes.cc |
@@ -254,17 +254,24 @@ Scope* Scope::DeserializeScopeChain(Isolate* isolate, Zone* zone, |
} |
} else if (context->IsScriptContext()) { |
Handle<ScopeInfo> scope_info(context->scope_info(), isolate); |
+ DCHECK(scope_info->scope_type() == SCRIPT_SCOPE); |
Toon Verwaest
2016/08/19 12:48:52
DCHECK_EQ
|
current_scope = new (zone) |
DeclarationScope(zone, current_scope, SCRIPT_SCOPE, scope_info); |
} else if (context->IsFunctionContext()) { |
Handle<ScopeInfo> scope_info(context->closure()->shared()->scope_info(), |
isolate); |
+ // TODO(neis): For an eval scope, we currently create an ordinary function |
+ // context. This is wrong and needs to be fixed. |
+ // https://bugs.chromium.org/p/v8/issues/detail?id=5295 |
+ DCHECK(scope_info->scope_type() == FUNCTION_SCOPE || |
+ scope_info->scope_type() == EVAL_SCOPE); |
current_scope = new (zone) |
DeclarationScope(zone, current_scope, FUNCTION_SCOPE, scope_info); |
if (scope_info->IsAsmFunction()) current_scope->asm_function_ = true; |
if (scope_info->IsAsmModule()) current_scope->asm_module_ = true; |
} else if (context->IsBlockContext()) { |
Handle<ScopeInfo> scope_info(context->scope_info(), isolate); |
+ DCHECK(scope_info->scope_type() == BLOCK_SCOPE); |
Toon Verwaest
2016/08/19 12:48:52
DCHECK_EQ
|
if (scope_info->is_declaration_scope()) { |
current_scope = new (zone) |
DeclarationScope(zone, current_scope, BLOCK_SCOPE, scope_info); |