Index: third_party/WebKit/Source/bindings/core/v8/ScriptModule.cpp |
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptModule.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptModule.cpp |
index fda3bcb4b64e543789bca503174aa168bc90f3d9..2826d8e3869a4021e0aa9c4fb611efcdd077daa8 100644 |
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptModule.cpp |
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptModule.cpp |
@@ -42,6 +42,7 @@ ScriptModule ScriptModule::Compile(v8::Isolate* isolate, |
ScriptValue ScriptModule::Instantiate(ScriptState* script_state) { |
v8::Isolate* isolate = script_state->GetIsolate(); |
v8::TryCatch try_catch(isolate); |
+ try_catch.SetVerbose(true); |
DCHECK(!IsNull()); |
v8::Local<v8::Context> context = script_state->GetContext(); |
@@ -55,16 +56,23 @@ ScriptValue ScriptModule::Instantiate(ScriptState* script_state) { |
return ScriptValue(); |
} |
-void ScriptModule::Evaluate(ScriptState* script_state) { |
+void ScriptModule::Evaluate(ScriptState* script_state) const { |
v8::Isolate* isolate = script_state->GetIsolate(); |
+ |
+ // Isolate exceptions that occur when executing the code. These exceptions |
+ // should not interfere with javascript code we might evaluate from C++ when |
+ // returning from here. |
v8::TryCatch try_catch(isolate); |
try_catch.SetVerbose(true); |
+ |
+ // TODO(kouhei): We currently don't have a code-path which use return value of |
+ // EvaluateModule. Stop ignoring result once we have such path. |
v8::Local<v8::Value> result; |
if (!V8Call( |
V8ScriptRunner::EvaluateModule(module_->NewLocal(isolate), |
script_state->GetContext(), isolate), |
result, try_catch)) { |
- // TODO(adamk): report error |
+ return; |
} |
} |