|
@@ -3712,7 +3712,11 @@ gin::Handle<WebContents> WebContents::New(
|
|
|
const gin_helper::Dictionary& options) {
|
|
|
gin::Handle<WebContents> handle =
|
|
|
gin::CreateHandle(isolate, new WebContents(isolate, options));
|
|
|
+ v8::TryCatch try_catch(isolate);
|
|
|
gin_helper::CallMethod(isolate, handle.get(), "_init");
|
|
|
+ if (try_catch.HasCaught()) {
|
|
|
+ node::errors::TriggerUncaughtException(isolate, try_catch);
|
|
|
+ }
|
|
|
return handle;
|
|
|
}
|
|
|
|
|
@@ -3723,7 +3727,11 @@ gin::Handle<WebContents> WebContents::CreateAndTake(
|
|
|
Type type) {
|
|
|
gin::Handle<WebContents> handle = gin::CreateHandle(
|
|
|
isolate, new WebContents(isolate, std::move(web_contents), type));
|
|
|
+ v8::TryCatch try_catch(isolate);
|
|
|
gin_helper::CallMethod(isolate, handle.get(), "_init");
|
|
|
+ if (try_catch.HasCaught()) {
|
|
|
+ node::errors::TriggerUncaughtException(isolate, try_catch);
|
|
|
+ }
|
|
|
return handle;
|
|
|
}
|
|
|
|
|
@@ -3743,7 +3751,11 @@ gin::Handle<WebContents> WebContents::FromOrCreate(
|
|
|
WebContents* api_web_contents = From(web_contents);
|
|
|
if (!api_web_contents) {
|
|
|
api_web_contents = new WebContents(isolate, web_contents);
|
|
|
+ v8::TryCatch try_catch(isolate);
|
|
|
gin_helper::CallMethod(isolate, api_web_contents, "_init");
|
|
|
+ if (try_catch.HasCaught()) {
|
|
|
+ node::errors::TriggerUncaughtException(isolate, try_catch);
|
|
|
+ }
|
|
|
}
|
|
|
return gin::CreateHandle(isolate, api_web_contents);
|
|
|
}
|