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

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

Issue 2061113002: Remove ExceptionState::throwIfNeeded Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: temp Created 4 years, 5 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: third_party/WebKit/Source/bindings/core/v8/ExceptionState.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/ExceptionState.cpp b/third_party/WebKit/Source/bindings/core/v8/ExceptionState.cpp
index 191f03d3b479194f68f80f5fbf6397e7c662c34c..2e6b79a7ac4cda71c9fb86c473237f10a3fcf19d 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ExceptionState.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ExceptionState.cpp
@@ -37,6 +37,12 @@
namespace blink {
+ExceptionState::~ExceptionState()
+{
+ if (!m_exception.isEmpty())
+ throwException();
+}
+
void ExceptionState::clearException()
{
m_code = 0;
@@ -46,6 +52,7 @@ void ExceptionState::clearException()
ScriptPromise ExceptionState::reject(ScriptState* scriptState)
{
ScriptPromise promise = ScriptPromise::reject(scriptState, m_exception.newLocal(scriptState->isolate()));
+ throwException();
clearException();
return promise;
}
@@ -53,6 +60,7 @@ ScriptPromise ExceptionState::reject(ScriptState* scriptState)
void ExceptionState::reject(ScriptPromiseResolver* resolver)
{
resolver->reject(m_exception.newLocal(resolver->getScriptState()->isolate()));
+ throwException();
clearException();
}
@@ -98,6 +106,7 @@ void ExceptionState::throwException()
{
ASSERT(!m_exception.isEmpty());
V8ThrowException::throwException(m_exception.newLocal(m_isolate), m_isolate);
+ clearException();
}
void ExceptionState::throwTypeError(const String& message)

Powered by Google App Engine
This is Rietveld 408576698