Index: Source/bindings/core/dart/DartJsInterop.cpp |
diff --git a/Source/bindings/core/dart/DartJsInterop.cpp b/Source/bindings/core/dart/DartJsInterop.cpp |
index 4afe555d642e06a1da77065ccd5bf18c0dba5f38..80bda03720c1b086ea9c67221804044cc6ce17bd 100644 |
--- a/Source/bindings/core/dart/DartJsInterop.cpp |
+++ b/Source/bindings/core/dart/DartJsInterop.cpp |
@@ -978,8 +978,15 @@ static void callMethodCallback(Dart_NativeArguments args) |
v8::Local<v8::Value> value = v8Receiver->Get(V8Converter::stringToV8(name)); |
v8::Local<v8::Value> ret; |
+ |
if (value->IsFunction()) { |
- ret = V8ScriptRunner::callFunction(value.As<v8::Function>(), DartUtilities::scriptExecutionContext(), receiver->localV8Object(), v8Args.size(), v8Args.data(), v8::Isolate::GetCurrent()).ToLocalChecked(); |
+ |
+ v8::Local<v8::Value> result; |
+ if (!V8ScriptRunner::callFunction(value.As<v8::Function>(), |
+ DartUtilities::scriptExecutionContext(), receiver->localV8Object(), v8Args.size(), v8Args.data(), v8::Isolate::GetCurrent()).ToLocal(&ret)) { |
+ exception = Dart_NewStringFromCString("V8 Exception"); |
+ goto fail; |
+ } |
} else { |
// FIXME: we currently convert this exception to a NoSuchMethod |
// exception in the Dart code that wraps this native method. |
@@ -1113,12 +1120,16 @@ static void applyCallback(Dart_NativeArguments args) |
} |
} |
- v8::Local<v8::Value> ret = V8ScriptRunner::callFunction(receiver->localV8Function(), |
- DartUtilities::scriptExecutionContext(), |
- thisArg.As<v8::Object>(), |
- v8Args.size(), |
- v8Args.data(), |
- v8::Isolate::GetCurrent()).ToLocalChecked(); |
+ v8::Local<v8::Value> ret; |
+ if (!V8ScriptRunner::callFunction(receiver->localV8Function(), |
+ DartUtilities::scriptExecutionContext(), |
+ thisArg.As<v8::Object>(), |
+ v8Args.size(), |
+ v8Args.data(), |
+ v8::Isolate::GetCurrent()).ToLocal(&ret)) { |
+ exception = Dart_NewStringFromCString("V8 Exception"); |
+ goto fail; |
+ } |
if (scopes.handleJsException(&exception)) |
goto fail; |
scopes.setReturnValue(ret); |
@@ -1158,12 +1169,16 @@ static void applyDebuggerOnlyCallback(Dart_NativeArguments args) |
} |
} |
- v8::Local<v8::Value> ret = V8ScriptRunner::callFunction(receiver->localV8Function(), |
- DartUtilities::scriptExecutionContext(), |
- thisArg.As<v8::Object>(), |
- v8Args.size(), |
- v8Args.data(), |
- v8::Isolate::GetCurrent()).ToLocalChecked(); |
+ v8::Local<v8::Value> ret; |
+ if (!V8ScriptRunner::callFunction(receiver->localV8Function(), |
+ DartUtilities::scriptExecutionContext(), |
+ thisArg.As<v8::Object>(), |
+ v8Args.size(), |
+ v8Args.data(), |
+ v8::Isolate::GetCurrent()).ToLocal(&ret)) { |
+ exception = Dart_NewStringFromCString("V8 Exception"); |
+ goto fail; |
+ } |
if (scopes.handleJsException(&exception)) |
goto fail; |
scopes.setReturnValue(ret); |