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

Unified Diff: src/runtime.cc

Issue 10872084: Allocate block-scoped global bindings to global context. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 4 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
« src/parser.cc ('K') | « src/rewriter.cc ('k') | src/scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 5b0bfc353551004ad23760b81362a1d6ad4c2994..6041ee0f73d3fe120359eb6563cc1b36e669cbfb 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -8749,7 +8749,10 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NewGlobalContext) {
isolate->heap()->AllocateGlobalContext(function, scope_info);
if (!maybe_result->To(&result)) return maybe_result;
+ ASSERT(function->context() == isolate->context());
+ ASSERT(function->context()->global_object() == result->global_object());
isolate->set_context(result);
+ result->global_object()->set_global_context(result);
return result; // non-failure
}
@@ -11272,7 +11275,7 @@ class ScopeIterator {
} else {
ASSERT(scope_info->Type() == EVAL_SCOPE);
info.MarkAsEval();
- info.SetCallingContext(Handle<Context>(function_->context()));
+ info.SetContext(Handle<Context>(function_->context()));
}
if (ParserApi::Parse(&info, kNoParsingFlags) && Scope::Analyze(&info)) {
scope = info.function()->scope();
« src/parser.cc ('K') | « src/rewriter.cc ('k') | src/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698