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

Unified Diff: Source/bindings/tests/results/V8TestInterface.cpp

Issue 232563003: API functions returning Promises should not throw exceptions. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
Index: Source/bindings/tests/results/V8TestInterface.cpp
diff --git a/Source/bindings/tests/results/V8TestInterface.cpp b/Source/bindings/tests/results/V8TestInterface.cpp
index f2d2f31fcb8dd3da50725fe6eea58f35de573dd8..bb87a1ad313c597bf36e38de578eababb5239d74 100644
--- a/Source/bindings/tests/results/V8TestInterface.cpp
+++ b/Source/bindings/tests/results/V8TestInterface.cpp
@@ -812,8 +812,10 @@ static void implementsComplexMethodMethod(const v8::FunctionCallbackInfo<v8::Val
TONATIVE_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceEmpty::toNativeWithTypeCheck(info.GetIsolate(), info[1]));
ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate());
RefPtr<TestInterfaceEmpty> result = impl->implementsComplexMethod(scriptContext, strArg, testInterfaceEmptyArg, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
+ exceptionState.throwIfNeeded();
return;
+ }
v8SetReturnValue(info, result.release());
}
@@ -949,8 +951,10 @@ static void partialCallWithExecutionContextRaisesExceptionVoidMethodMethod(const
ASSERT(impl);
ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate());
TestPartialInterface::partialCallWithExecutionContextRaisesExceptionVoidMethod(scriptContext, *impl, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
+ exceptionState.throwIfNeeded();
return;
+ }
}
#endif // ENABLE(PARTIAL_CONDITION)

Powered by Google App Engine
This is Rietveld 408576698