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

Unified Diff: src/runtime/runtime-scopes.cc

Issue 1129723003: Revert of Resolve references to "this" the same way as normal variables (Closed) Base URL: https://chromium.googlesource.com/v8/v8@master
Patch Set: Created 5 years, 7 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/runtime/runtime-debug.cc ('k') | src/scopeinfo.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-scopes.cc
diff --git a/src/runtime/runtime-scopes.cc b/src/runtime/runtime-scopes.cc
index 1de2c4c31d1989786272b42e22cc8825bf7aa4f3..7a523a7cac41b3783be5f99f381f313d76cdb3fa 100644
--- a/src/runtime/runtime-scopes.cc
+++ b/src/runtime/runtime-scopes.cc
@@ -250,12 +250,6 @@
JSGlobalObject::cast(context_arg->extension()), isolate);
return DeclareGlobals(isolate, global, name, value, attr, is_var, is_const,
is_function);
- } else if (context->IsScriptContext()) {
- DCHECK(context->global_object()->IsJSGlobalObject());
- Handle<JSGlobalObject> global(
- JSGlobalObject::cast(context->global_object()), isolate);
- return DeclareGlobals(isolate, global, name, value, attr, is_var, is_const,
- is_function);
}
if (attributes != ABSENT) {
@@ -331,12 +325,8 @@
// meanwhile. If so, re-introduce the variable in the context extension.
if (attributes == ABSENT) {
Handle<Context> declaration_context(context_arg->declaration_context());
- if (declaration_context->IsScriptContext()) {
- holder = handle(declaration_context->global_object(), isolate);
- } else {
- DCHECK(declaration_context->has_extension());
- holder = handle(declaration_context->extension(), isolate);
- }
+ DCHECK(declaration_context->has_extension());
+ holder = handle(declaration_context->extension(), isolate);
CHECK(holder->IsJSObject());
} else {
// For JSContextExtensionObjects, the initializer can be run multiple times
@@ -640,12 +630,8 @@
FindNameClash(scope_info, global_object, script_context_table);
if (isolate->has_pending_exception()) return name_clash_result;
- // Script contexts have a canonical empty function as their closure, not the
- // anonymous closure containing the global code. See
- // FullCodeGenerator::PushFunctionArgumentForContextAllocation.
- Handle<JSFunction> closure(native_context->closure());
Handle<Context> result =
- isolate->factory()->NewScriptContext(closure, scope_info);
+ isolate->factory()->NewScriptContext(function, scope_info);
DCHECK(function->context() == isolate->context());
DCHECK(function->context()->global_object() == result->global_object());
« no previous file with comments | « src/runtime/runtime-debug.cc ('k') | src/scopeinfo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698