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

Unified Diff: src/bootstrapper.cc

Issue 1207003: Implement support for reattaching a global object to a context. This... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 9 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/bootstrapper.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
===================================================================
--- src/bootstrapper.cc (revision 4246)
+++ src/bootstrapper.cc (working copy)
@@ -309,6 +309,17 @@
}
+void Bootstrapper::ReattachGlobal(Handle<Context> env,
+ Handle<Object> global_object) {
+ ASSERT(global_object->IsJSGlobalProxy());
+ Handle<JSGlobalProxy> global = Handle<JSGlobalProxy>::cast(global_object);
+ env->global()->set_global_receiver(*global);
+ env->set_global_proxy(*global);
+ SetObjectPrototype(global, Handle<JSObject>(env->global()));
+ global->set_context(*env);
+}
+
+
static Handle<JSFunction> InstallFunction(Handle<JSObject> target,
const char* name,
InstanceType type,
« no previous file with comments | « src/bootstrapper.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698