Index: src/bootstrapper.cc |
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc |
index 596b480b70f8526956264cc2d10b5f6511f0a351..f40aa456ef9e858a16398caf3cb9fd7690fe681f 100644 |
--- a/src/bootstrapper.cc |
+++ b/src/bootstrapper.cc |
@@ -303,11 +303,10 @@ 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); |
+ Handle<Context> env = genesis.result(); |
+ if (!env.is_null()) { |
if (InstallExtensions(env, extensions)) { |
Sven Panne
2013/04/09 07:08:33
Merge the "if"s, move the last "return" to an "els
Michael Starzinger
2013/04/09 13:29:18
Done.
|
- return env; |
+ return scope.CloseAndEscape(env); |
} |
} |
return Handle<Context>(); |