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

Unified Diff: src/ast/scopes.cc

Issue 2435023002: Use a different map to distinguish eval contexts (Closed)
Patch Set: relax dchecks Created 4 years, 1 month 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
Index: src/ast/scopes.cc
diff --git a/src/ast/scopes.cc b/src/ast/scopes.cc
index ad9330538ab9260b8e586d65d24976e88ec4e749..e783fb1f8273d91d1bb0fde4e4c358f066d2b99f 100644
--- a/src/ast/scopes.cc
+++ b/src/ast/scopes.cc
@@ -354,17 +354,20 @@ Scope* Scope::DeserializeScopeChain(Isolate* isolate, Zone* zone,
}
DCHECK(!scope_info->HasOuterScopeInfo());
break;
- } else if (scope_info->scope_type() == FUNCTION_SCOPE ||
- scope_info->scope_type() == EVAL_SCOPE) {
- // 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
+ } else if (scope_info->scope_type() == FUNCTION_SCOPE) {
outer_scope =
new (zone) DeclarationScope(zone, FUNCTION_SCOPE, handle(scope_info));
if (scope_info->IsAsmFunction())
outer_scope->AsDeclarationScope()->set_asm_function();
if (scope_info->IsAsmModule())
outer_scope->AsDeclarationScope()->set_asm_module();
+ } else if (scope_info->scope_type() == EVAL_SCOPE) {
+ if (scope_info->is_declaration_scope()) {
+ outer_scope =
adamk 2016/11/12 00:26:05 Can you add a DCHECK here that scope_info->languag
Dan Ehrenberg 2016/12/07 05:41:26 Actually, deleted this code, as it wasn't doing an
+ new (zone) DeclarationScope(zone, EVAL_SCOPE, handle(scope_info));
+ } else {
+ outer_scope = new (zone) Scope(zone, EVAL_SCOPE, handle(scope_info));
+ }
} else if (scope_info->scope_type() == BLOCK_SCOPE) {
if (scope_info->is_declaration_scope()) {
outer_scope =
« no previous file with comments | « src/arm64/interface-descriptors-arm64.cc ('k') | src/code-factory.h » ('j') | src/contexts.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698