Remove incorrect assumption that a failed context creation throws

BUG=chromium:696464
R=yangguo@chromium.org

Change-Id: Ie873e8af6af4dd95897f5f85e0eac5a350f59b32
Reviewed-on: https://chromium-review.googlesource.com/449714
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Jochen Eisinger <jochen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43668}
This commit is contained in:
Jochen Eisinger 2017-03-07 11:39:15 +01:00 committed by Commit Bot
parent dcf46a67c0
commit dee757f43b
2 changed files with 4 additions and 11 deletions

View File

@ -6367,9 +6367,7 @@ Local<Context> NewContext(
isolate, extensions, global_template, global_object,
context_snapshot_index, internal_fields_deserializer);
if (env.is_null()) {
if (isolate->has_pending_exception()) {
isolate->OptionalRescheduleException(true);
}
if (isolate->has_pending_exception()) isolate->clear_pending_exception();
return Local<Context>();
}
return Utils::ToLocal(scope.CloseAndEscape(env));
@ -6420,9 +6418,7 @@ MaybeLocal<Object> v8::Context::NewRemoteContext(
global_object, 0,
DeserializeInternalFieldsCallback());
if (global_proxy.is_null()) {
if (isolate->has_pending_exception()) {
isolate->OptionalRescheduleException(true);
}
if (isolate->has_pending_exception()) isolate->clear_pending_exception();
return MaybeLocal<Object>();
}
return Utils::ToLocal(

View File

@ -881,11 +881,8 @@ MaybeLocal<Context> Shell::CreateRealm(
Local<ObjectTemplate> global_template = CreateGlobalTemplate(isolate);
Local<Context> context =
Context::New(isolate, NULL, global_template, global_object);
if (context.IsEmpty()) {
DCHECK(try_catch.HasCaught());
try_catch.ReThrow();
return MaybeLocal<Context>();
}
DCHECK(!try_catch.HasCaught());
if (context.IsEmpty()) return MaybeLocal<Context>();
InitializeModuleEmbedderData(context);
data->realms_[index].Reset(isolate, context);
args.GetReturnValue().Set(index);