Index: src/bootstrapper.cc |
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc |
index 596b480b70f8526956264cc2d10b5f6511f0a351..65012e390888dcc7cadb33ce50c13c485cbd224d 100644 |
--- a/src/bootstrapper.cc |
+++ b/src/bootstrapper.cc |
@@ -303,14 +303,9 @@ 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; |
- } |
- } |
- return Handle<Context>(); |
+ Handle<Context> env = genesis.result(); |
+ if (env.is_null() || !InstallExtensions(env, extensions)) Handle<Context>(); |
Sven Panne
2013/04/09 13:52:28
A "return" might be helpful here... ;-)
Michael Starzinger
2013/04/10 09:01:11
Done. Yeah, a "return" might come in handy here. :
|
+ return scope.CloseAndEscape(env); |
} |