Title: [214897] trunk/Source/WebCore
Revision
214897
Author
[email protected]
Date
2017-04-04 14:11:38 -0700 (Tue, 04 Apr 2017)

Log Message

[Debug] ASSERT(!throwScope.exception()) on imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-worker.html
https://bugs.webkit.org/show_bug.cgi?id=170395
<rdar://problem/31394017>

Patch by Youenn Fablet <[email protected]> on 2017-04-04
Reviewed by Mark Lam.

No change of behavior.

* bindings/js/JSDOMPromise.cpp:
(WebCore::DeferredPromise::reject): Adding early ASSERT that creating an exception is happening correctly.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (214896 => 214897)


--- trunk/Source/WebCore/ChangeLog	2017-04-04 21:08:43 UTC (rev 214896)
+++ trunk/Source/WebCore/ChangeLog	2017-04-04 21:11:38 UTC (rev 214897)
@@ -1,3 +1,16 @@
+2017-04-04  Youenn Fablet  <[email protected]>
+
+        [Debug] ASSERT(!throwScope.exception()) on imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-worker.html
+        https://bugs.webkit.org/show_bug.cgi?id=170395
+        <rdar://problem/31394017>
+
+        Reviewed by Mark Lam.
+
+        No change of behavior.
+
+        * bindings/js/JSDOMPromise.cpp:
+        (WebCore::DeferredPromise::reject): Adding early ASSERT that creating an exception is happening correctly.
+
 2017-04-04  Alexey Proskuryakov  <[email protected]>
 
         Rolling back the build fix, as it broke other builds.

Modified: trunk/Source/WebCore/bindings/js/JSDOMPromise.cpp (214896 => 214897)


--- trunk/Source/WebCore/bindings/js/JSDOMPromise.cpp	2017-04-04 21:08:43 UTC (rev 214896)
+++ trunk/Source/WebCore/bindings/js/JSDOMPromise.cpp	2017-04-04 21:11:38 UTC (rev 214897)
@@ -94,7 +94,12 @@
     ASSERT(m_globalObject);
     auto& state = *m_globalObject->globalExec();
     JSC::JSLockHolder locker(&state);
-    reject(state, createDOMException(state, WTFMove(exception)));
+
+    auto scope = DECLARE_CATCH_SCOPE(state.vm());
+    auto error = createDOMException(state, WTFMove(exception));
+    ASSERT_UNUSED(scope, !scope.exception());
+
+    reject(state, error);
 }
 
 void DeferredPromise::reject(ExceptionCode ec, const String& message)
@@ -104,9 +109,14 @@
 
     ASSERT(deferred());
     ASSERT(m_globalObject);
-    JSC::ExecState* state = m_globalObject->globalExec();
-    JSC::JSLockHolder locker(state);
-    reject(*state, createDOMException(state, ec, message));
+    auto& state = *m_globalObject->globalExec();
+    JSC::JSLockHolder locker(&state);
+
+    auto scope = DECLARE_CATCH_SCOPE(state.vm());
+    auto error = createDOMException(&state, ec, message);
+    ASSERT_UNUSED(scope, !scope.exception());
+
+    reject(state, error);
 }
 
 void DeferredPromise::reject(const JSC::PrivateName& privateName)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to