Title: [244040] trunk
Revision
244040
Author
sbar...@apple.com
Date
2019-04-08 13:46:39 -0700 (Mon, 08 Apr 2019)

Log Message

WebAssembly.RuntimeError missing exception check
https://bugs.webkit.org/show_bug.cgi?id=196700
<rdar://problem/49693932>

Reviewed by Yusuke Suzuki.

JSTests:

* wasm/js-api/runtime-error-should-exception-check.js: Added.

Source/_javascript_Core:

* wasm/js/JSWebAssemblyRuntimeError.h:
* wasm/js/WebAssemblyRuntimeErrorConstructor.cpp:
(JSC::constructJSWebAssemblyRuntimeError):

Modified Paths

Added Paths

Diff

Modified: trunk/JSTests/ChangeLog (244039 => 244040)


--- trunk/JSTests/ChangeLog	2019-04-08 20:46:34 UTC (rev 244039)
+++ trunk/JSTests/ChangeLog	2019-04-08 20:46:39 UTC (rev 244040)
@@ -1,3 +1,13 @@
+2019-04-08  Saam Barati  <sbar...@apple.com>
+
+        WebAssembly.RuntimeError missing exception check
+        https://bugs.webkit.org/show_bug.cgi?id=196700
+        <rdar://problem/49693932>
+
+        Reviewed by Yusuke Suzuki.
+
+        * wasm/js-api/runtime-error-should-exception-check.js: Added.
+
 2019-04-08  Yusuke Suzuki  <ysuz...@apple.com>
 
         Unreviewed, rolling in r243948 with test fix

Added: trunk/JSTests/wasm/js-api/runtime-error-should-exception-check.js (0 => 244040)


--- trunk/JSTests/wasm/js-api/runtime-error-should-exception-check.js	                        (rev 0)
+++ trunk/JSTests/wasm/js-api/runtime-error-should-exception-check.js	2019-04-08 20:46:39 UTC (rev 244040)
@@ -0,0 +1 @@
+new WebAssembly.RuntimeError({});

Modified: trunk/Source/_javascript_Core/ChangeLog (244039 => 244040)


--- trunk/Source/_javascript_Core/ChangeLog	2019-04-08 20:46:34 UTC (rev 244039)
+++ trunk/Source/_javascript_Core/ChangeLog	2019-04-08 20:46:39 UTC (rev 244040)
@@ -1,3 +1,15 @@
+2019-04-08  Saam Barati  <sbar...@apple.com>
+
+        WebAssembly.RuntimeError missing exception check
+        https://bugs.webkit.org/show_bug.cgi?id=196700
+        <rdar://problem/49693932>
+
+        Reviewed by Yusuke Suzuki.
+
+        * wasm/js/JSWebAssemblyRuntimeError.h:
+        * wasm/js/WebAssemblyRuntimeErrorConstructor.cpp:
+        (JSC::constructJSWebAssemblyRuntimeError):
+
 2019-04-08  Yusuke Suzuki  <ysuz...@apple.com>
 
         Unreviewed, rolling in r243948 with test fix

Modified: trunk/Source/_javascript_Core/wasm/js/JSWebAssemblyRuntimeError.h (244039 => 244040)


--- trunk/Source/_javascript_Core/wasm/js/JSWebAssemblyRuntimeError.h	2019-04-08 20:46:34 UTC (rev 244039)
+++ trunk/Source/_javascript_Core/wasm/js/JSWebAssemblyRuntimeError.h	2019-04-08 20:46:39 UTC (rev 244040)
@@ -36,10 +36,6 @@
     typedef ErrorInstance Base;
 
     static JSWebAssemblyRuntimeError* create(ExecState*, VM&, Structure*, const String&);
-    static JSWebAssemblyRuntimeError* create(ExecState* exec, VM& vm, Structure* structure, JSValue message)
-    {
-        return create(exec, vm, structure, message.isUndefined() ? String() : message.toWTFString(exec));
-    }
 
     DECLARE_INFO;
 

Modified: trunk/Source/_javascript_Core/wasm/js/WebAssemblyRuntimeErrorConstructor.cpp (244039 => 244040)


--- trunk/Source/_javascript_Core/wasm/js/WebAssemblyRuntimeErrorConstructor.cpp	2019-04-08 20:46:34 UTC (rev 244039)
+++ trunk/Source/_javascript_Core/wasm/js/WebAssemblyRuntimeErrorConstructor.cpp	2019-04-08 20:46:39 UTC (rev 244040)
@@ -49,9 +49,11 @@
     auto& vm = exec->vm();
     auto scope = DECLARE_THROW_SCOPE(vm);
     JSValue message = exec->argument(0);
+    String messageString = message.isUndefined() ? String() : message.toWTFString(exec);
+    RETURN_IF_EXCEPTION(scope, encodedJSValue());
     auto* structure = InternalFunction::createSubclassStructure(exec, exec->newTarget(), jsCast<InternalFunction*>(exec->jsCallee())->globalObject(vm)->webAssemblyRuntimeErrorStructure());
     RETURN_IF_EXCEPTION(scope, encodedJSValue());
-    return JSValue::encode(JSWebAssemblyRuntimeError::create(exec, vm, structure, message));
+    return JSValue::encode(JSWebAssemblyRuntimeError::create(exec, vm, structure, WTFMove(messageString)));
 }
 
 static EncodedJSValue JSC_HOST_CALL callJSWebAssemblyRuntimeError(ExecState* exec)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to