Title: [279178] trunk/Source/WebCore
Revision
279178
Author
[email protected]
Date
2021-06-23 12:11:59 -0700 (Wed, 23 Jun 2021)

Log Message

Remove unneeded explicit exception checks in ScriptModuleLoader::evaluate().
https://bugs.webkit.org/show_bug.cgi?id=227302

Reviewed by Yusuke Suzuki.

A RELEASE_AND_RETURN will do because we're just propagating the exception to the
client in both cases.

* bindings/js/ScriptModuleLoader.cpp:
(WebCore::ScriptModuleLoader::evaluate):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (279177 => 279178)


--- trunk/Source/WebCore/ChangeLog	2021-06-23 18:49:44 UTC (rev 279177)
+++ trunk/Source/WebCore/ChangeLog	2021-06-23 19:11:59 UTC (rev 279178)
@@ -1,3 +1,16 @@
+2021-06-23  Mark Lam  <[email protected]>
+
+        Remove unneeded explicit exception checks in ScriptModuleLoader::evaluate().
+        https://bugs.webkit.org/show_bug.cgi?id=227302
+
+        Reviewed by Yusuke Suzuki.
+
+        A RELEASE_AND_RETURN will do because we're just propagating the exception to the
+        client in both cases.
+
+        * bindings/js/ScriptModuleLoader.cpp:
+        (WebCore::ScriptModuleLoader::evaluate):
+
 2021-06-23  Kimmo Kinnunen  <[email protected]>
 
         rAF driven WebGL submits excessive amount of GPU work when frames are slow

Modified: trunk/Source/WebCore/bindings/js/ScriptModuleLoader.cpp (279177 => 279178)


--- trunk/Source/WebCore/bindings/js/ScriptModuleLoader.cpp	2021-06-23 18:49:44 UTC (rev 279177)
+++ trunk/Source/WebCore/bindings/js/ScriptModuleLoader.cpp	2021-06-23 19:11:59 UTC (rev 279178)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015-2019 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2021 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -244,18 +244,12 @@
         return JSC::throwTypeError(jsGlobalObject, scope, "Module key is an invalid URL."_s);
 
     if (m_ownerType == OwnerType::Document) {
-        if (auto* frame = downcast<Document>(m_context).frame()) {
-            auto jsValue = frame->script().evaluateModule(sourceURL, *moduleRecord, awaitedValue, resumeMode);
-            RETURN_IF_EXCEPTION(scope, JSC::jsUndefined());
-            return jsValue;
-        }
+        if (auto* frame = downcast<Document>(m_context).frame())
+            RELEASE_AND_RETURN(scope, frame->script().evaluateModule(sourceURL, *moduleRecord, awaitedValue, resumeMode));
     } else {
         ASSERT(is<WorkerOrWorkletGlobalScope>(m_context));
-        if (auto* script = downcast<WorkerOrWorkletGlobalScope>(m_context).script()) {
-            auto jsValue = script->evaluateModule(*moduleRecord, awaitedValue, resumeMode);
-            RETURN_IF_EXCEPTION(scope, JSC::jsUndefined());
-            return jsValue;
-        }
+        if (auto* script = downcast<WorkerOrWorkletGlobalScope>(m_context).script())
+            RELEASE_AND_RETURN(scope, script->evaluateModule(*moduleRecord, awaitedValue, resumeMode));
     }
     return JSC::jsUndefined();
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to