Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 560dc34b3004860c59c24f2c60e10c0bef7ce342..03489d94916b3c2f4f7d87baad52e59be1fc2a53 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -5584,7 +5584,12 @@ Local<Context> v8::Context::New( |
if (extensions == NULL) extensions = &no_extensions; |
i::Handle<i::Context> env = |
CreateEnvironment(isolate, extensions, global_template, global_object); |
- if (env.is_null()) return Local<Context>(); |
+ if (env.is_null()) { |
+ if (isolate->has_pending_exception()) { |
+ isolate->OptionalRescheduleException(true); |
+ } |
+ return Local<Context>(); |
+ } |
return Utils::ToLocal(scope.CloseAndEscape(env)); |
} |