Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ScriptModule.cpp

Issue 2821903002: [ES6 modules] Minor fixes to v8::ScriptModule (Closed)
Patch Set: actually setverbose Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ScriptModule.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
}
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ScriptModule.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698