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

Unified Diff: src/bootstrapper.cc

Issue 13799003: Change Context::New not create persistent handles. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Adapted cctest initialization to new API. Created 7 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/api.cc ('k') | src/debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 596b480b70f8526956264cc2d10b5f6511f0a351..a7c2bac25d61bd0987c33b08d9e8ea26fba4d6aa 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -303,14 +303,11 @@ Handle<Context> Bootstrapper::CreateEnvironment(
v8::ExtensionConfiguration* extensions) {
HandleScope scope(isolate_);
Genesis genesis(isolate_, global_object, global_template, extensions);
- if (!genesis.result().is_null()) {
- Handle<Object> ctx(isolate_->global_handles()->Create(*genesis.result()));
- Handle<Context> env = Handle<Context>::cast(ctx);
- if (InstallExtensions(env, extensions)) {
- return env;
- }
+ Handle<Context> env = genesis.result();
+ if (env.is_null() || !InstallExtensions(env, extensions)) {
+ return Handle<Context>();
}
- return Handle<Context>();
+ return scope.CloseAndEscape(env);
}
« no previous file with comments | « src/api.cc ('k') | src/debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698