Title: [264876] trunk
Revision
264876
Author
[email protected]
Date
2020-07-24 19:09:19 -0700 (Fri, 24 Jul 2020)

Log Message

Fixed exception check handling below ScheduledAction::executeFunctionInContext()
https://bugs.webkit.org/show_bug.cgi?id=214774

Reviewed by Mark Lam.

Source/WebCore:

Test: js/dom/scheduled-action-exception-checks.html

* bindings/js/ScheduledAction.cpp:
(WebCore::ScheduledAction::executeFunctionInContext):

LayoutTests:

New test.

* js/dom/scheduled-action-exception-checks-expected.txt: Added.
* js/dom/scheduled-action-exception-checks.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (264875 => 264876)


--- trunk/LayoutTests/ChangeLog	2020-07-25 02:00:24 UTC (rev 264875)
+++ trunk/LayoutTests/ChangeLog	2020-07-25 02:09:19 UTC (rev 264876)
@@ -1,3 +1,15 @@
+2020-07-24  Michael Saboff  <[email protected]>
+
+        Fixed exception check handling below ScheduledAction::executeFunctionInContext()
+        https://bugs.webkit.org/show_bug.cgi?id=214774
+
+        Reviewed by Mark Lam.
+
+        New test.
+
+        * js/dom/scheduled-action-exception-checks-expected.txt: Added.
+        * js/dom/scheduled-action-exception-checks.html: Added.
+
 2020-07-24  Yusuke Suzuki  <[email protected]>
 
         [JSC] Skip unrelated / too-compute-heavy tests in Apple Watch Series 3

Added: trunk/LayoutTests/js/dom/scheduled-action-exception-checks-expected.txt (0 => 264876)


--- trunk/LayoutTests/js/dom/scheduled-action-exception-checks-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/js/dom/scheduled-action-exception-checks-expected.txt	2020-07-25 02:09:19 UTC (rev 264876)
@@ -0,0 +1,4 @@
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/js/dom/scheduled-action-exception-checks.html (0 => 264876)


--- trunk/LayoutTests/js/dom/scheduled-action-exception-checks.html	                        (rev 0)
+++ trunk/LayoutTests/js/dom/scheduled-action-exception-checks.html	2020-07-25 02:09:19 UTC (rev 264876)
@@ -0,0 +1,12 @@
+<!DOCTYPE html><!-- webkit-test-runner [ jscOptions=--validateExceptionChecks=true ] -->
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script>
+  setTimeout(()=>{});
+</script>
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (264875 => 264876)


--- trunk/Source/WebCore/ChangeLog	2020-07-25 02:00:24 UTC (rev 264875)
+++ trunk/Source/WebCore/ChangeLog	2020-07-25 02:09:19 UTC (rev 264876)
@@ -1,3 +1,15 @@
+2020-07-24  Michael Saboff  <[email protected]>
+
+        Fixed exception check handling below ScheduledAction::executeFunctionInContext()
+        https://bugs.webkit.org/show_bug.cgi?id=214774
+
+        Reviewed by Mark Lam.
+
+        Test: js/dom/scheduled-action-exception-checks.html
+
+        * bindings/js/ScheduledAction.cpp:
+        (WebCore::ScheduledAction::executeFunctionInContext):
+
 2020-07-24  Brady Eidson  <[email protected]>
 
         Hard code some MFi controller devices instead of dynamically managing HID vs GameController.framework.

Modified: trunk/Source/WebCore/bindings/js/ScheduledAction.cpp (264875 => 264876)


--- trunk/Source/WebCore/bindings/js/ScheduledAction.cpp	2020-07-25 02:00:24 UTC (rev 264875)
+++ trunk/Source/WebCore/bindings/js/ScheduledAction.cpp	2020-07-25 02:09:19 UTC (rev 264876)
@@ -93,7 +93,7 @@
     ASSERT(m_function);
     VM& vm = context.vm();
     JSLockHolder lock(vm);
-    auto scope = DECLARE_THROW_SCOPE(vm);
+    auto catchScope = DECLARE_CATCH_SCOPE(vm);
 
     auto callData = getCallData(vm, m_function.get());
     if (callData.type == CallData::Type::None)
@@ -105,8 +105,12 @@
     for (auto& argument : m_arguments)
         arguments.append(argument.get());
     if (UNLIKELY(arguments.hasOverflowed())) {
-        throwOutOfMemoryError(lexicalGlobalObject, scope);
-        NakedPtr<JSC::Exception> exception = scope.exception();
+        {
+            auto throwScope = DECLARE_THROW_SCOPE(vm);
+            throwOutOfMemoryError(lexicalGlobalObject, throwScope);
+        }
+        NakedPtr<JSC::Exception> exception = catchScope.exception();
+        catchScope.clearException();
         reportException(lexicalGlobalObject, exception);
         return;
     }
@@ -115,7 +119,8 @@
 
     NakedPtr<JSC::Exception> exception;
     JSExecState::profiledCall(lexicalGlobalObject, JSC::ProfilingReason::Other, m_function.get(), callData, thisValue, arguments, exception);
-
+    EXCEPTION_ASSERT(!catchScope.exception());
+    
     InspectorInstrumentation::didCallFunction(&context);
 
     if (exception)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to