[webkit-reviews] review granted: [Bug 179826] WebAssembly JS API: throw when a promise can't be created : [Attachment 327201] patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Nov 17 12:56:32 PST 2017


Mark Lam <mark.lam at apple.com> has granted JF Bastien <jfbastien at apple.com>'s
request for review:
Bug 179826: WebAssembly JS API: throw when a promise can't be created
https://bugs.webkit.org/show_bug.cgi?id=179826

Attachment 327201: patch

https://bugs.webkit.org/attachment.cgi?id=327201&action=review




--- Comment #8 from Mark Lam <mark.lam at apple.com> ---
Comment on attachment 327201
  --> https://bugs.webkit.org/attachment.cgi?id=327201
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=327201&action=review

r=me with the remaining fix.

> Source/JavaScriptCore/wasm/js/WebAssemblyPrototype.cpp:205
> +	       RETURN_IF_EXCEPTION(catchScope, encodedJSValue());

This is still wrong.  For CatchScope, you should use clearException() here and
just return JSValue::encode(promise->promise()) below.	The client of this
function would expect to get the promise even if it's rejected, right?	In any
case, returning encodedJSValue() means returning a nullptr, and this will cause
crashes for when there are no exceptions.  You should never exit a CatchScope
with a pending exception.


More information about the webkit-reviews mailing list