Changeset 211410 in webkit


Ignore:
Timestamp:
Jan 30, 2017 11:21:43 PM (7 years ago)
Author:
Yusuke Suzuki
Message:

[JSC] Do not reject WebAssembly.compile() with Exception
https://bugs.webkit.org/show_bug.cgi?id=167585

Reviewed by Mark Lam.

JSTests:

  • wasm/js-api/Module-compile.js:

(async.testPromiseAPI):

Source/JavaScriptCore:

We accidentally reject the promise with Exception instead of Exception::value()
for the result of WebAssembly::compile().

  • wasm/JSWebAssembly.cpp:

(JSC::webAssemblyCompileFunc):

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r211319 r211410  
     12017-01-30  Yusuke Suzuki  <utatane.tea@gmail.com>
     2
     3        [JSC] Do not reject WebAssembly.compile() with Exception
     4        https://bugs.webkit.org/show_bug.cgi?id=167585
     5
     6        Reviewed by Mark Lam.
     7
     8        * wasm/js-api/Module-compile.js:
     9        (async.testPromiseAPI):
     10
    1112017-01-27  Yusuke Suzuki  <utatane.tea@gmail.com>
    212
  • trunk/JSTests/wasm/js-api/Module-compile.js

    r209979 r211410  
    2222            assert.truthy(e instanceof WebAssembly.CompileError);
    2323            assert.truthy(e.message === "WebAssembly.Module doesn't parse at byte 34 / 43: Memory section cannot exist if an Import has a memory (evaluating 'WebAssembly.compile(builder.WebAssembly().get())')");
     24        }
     25        assert.truthy(threw);
     26    }
     27
     28    {
     29        let threw = false;
     30        try {
     31            await WebAssembly.compile();
     32        } catch(e) {
     33            threw = true;
     34            assert.truthy(e instanceof TypeError);
     35            assert.eq(e.message, "first argument must be an ArrayBufferView or an ArrayBuffer (evaluating 'WebAssembly.compile()')");
    2436        }
    2537        assert.truthy(threw);
  • trunk/Source/JavaScriptCore/ChangeLog

    r211406 r211410  
     12017-01-30  Yusuke Suzuki  <utatane.tea@gmail.com>
     2
     3        [JSC] Do not reject WebAssembly.compile() with Exception
     4        https://bugs.webkit.org/show_bug.cgi?id=167585
     5
     6        Reviewed by Mark Lam.
     7
     8        We accidentally reject the promise with Exception instead of Exception::value()
     9        for the result of WebAssembly::compile().
     10
     11        * wasm/JSWebAssembly.cpp:
     12        (JSC::webAssemblyCompileFunc):
     13
    1142017-01-30  Joseph Pecoraro  <pecoraro@apple.com>
    215
  • trunk/Source/JavaScriptCore/wasm/JSWebAssembly.cpp

    r211247 r211410  
    5757    if (Exception* exception = catchScope.exception()) {
    5858        catchScope.clearException();
    59         promise->reject(exec, exception);
     59        promise->reject(exec, exception->value());
    6060        return JSValue::encode(promise->promise());
    6161    }
Note: See TracChangeset for help on using the changeset viewer.