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

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

Issue 1085263003: Eagerly declare eval scopes, even for sloppy scopes (Closed) Base URL: https://chromium.googlesource.com/v8/v8@master
Patch Set: Rebase Created 5 years, 8 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.cc ('k') | no next file » | 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 c92f027264ce3edc2974d269eb2dc8cd91f2b083..7a523a7cac41b3783be5f99f381f313d76cdb3fa 100644
--- a/src/runtime/runtime-scopes.cc
+++ b/src/runtime/runtime-scopes.cc
@@ -240,12 +240,17 @@ RUNTIME_FUNCTION(Runtime_DeclareLookupSlot) {
// TODO(verwaest): This case should probably not be covered by this function,
// but by DeclareGlobals instead.
- if ((attributes != ABSENT && holder->IsJSGlobalObject()) ||
- (context_arg->has_extension() &&
- context_arg->extension()->IsJSGlobalObject())) {
+ if (attributes != ABSENT && holder->IsJSGlobalObject()) {
return DeclareGlobals(isolate, Handle<JSGlobalObject>::cast(holder), name,
value, attr, is_var, is_const, is_function);
}
+ if (context_arg->has_extension() &&
+ context_arg->extension()->IsJSGlobalObject()) {
+ Handle<JSGlobalObject> global(
+ JSGlobalObject::cast(context_arg->extension()), isolate);
+ return DeclareGlobals(isolate, global, name, value, attr, is_var, is_const,
+ is_function);
+ }
if (attributes != ABSENT) {
// The name was declared before; check for conflicting re-declarations.
« no previous file with comments | « src/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698