Changeset 288064 in webkit


Ignore:
Timestamp:
Jan 15, 2022 1:17:40 PM (6 months ago)
Author:
ysuzuki@apple.com
Message:

[JSC] Fix misc WebAssembly.Table issues
https://bugs.webkit.org/show_bug.cgi?id=235262

Reviewed by Alexey Shvayka.

LayoutTests/imported/w3c:

Fix length of WebAssembly.Table.set from 2 to 1.
According to the spec[1], it should be 1 since the second argument is an optional.

Also fix stray argument test. Previously, it was stray argument. But after the update
of the wasm spec, the second argument of Table constructor can be used for initial value.
So, WebAssembly.Table "anyfunc" with {} initial value throws an error since it is not
a function. This fixes a test, passing null for the second argument, and adding third
stray argument for the stray argument test.

[1]: https://webassembly.github.io/spec/js-api/index.html#tables

  • web-platform-tests/wasm/jsapi/idlharness.any-expected.txt:
  • web-platform-tests/wasm/jsapi/idlharness.any.worker-expected.txt:
  • web-platform-tests/wasm/jsapi/interface.any.js:
  • web-platform-tests/wasm/jsapi/table/constructor.any-expected.txt:
  • web-platform-tests/wasm/jsapi/table/constructor.any.js:

(test):

  • web-platform-tests/wasm/jsapi/table/constructor.any.worker-expected.txt:

Source/JavaScriptCore:

  • wasm/js/WebAssemblyTablePrototype.cpp:
Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r288061 r288064  
     12022-01-15  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        [JSC] Fix misc WebAssembly.Table issues
     4        https://bugs.webkit.org/show_bug.cgi?id=235262
     5
     6        Reviewed by Alexey Shvayka.
     7
     8        Fix length of WebAssembly.Table.set from 2 to 1.
     9        According to the spec[1], it should be 1 since the second argument is an optional.
     10
     11        Also fix stray argument test. Previously, it was stray argument. But after the update
     12        of the wasm spec, the second argument of Table constructor can be used for initial value.
     13        So, WebAssembly.Table "anyfunc" with {} initial value throws an error since it is not
     14        a function. This fixes a test, passing null for the second argument, and adding third
     15        stray argument for the stray argument test.
     16
     17        [1]: https://webassembly.github.io/spec/js-api/index.html#tables
     18
     19        * web-platform-tests/wasm/jsapi/idlharness.any-expected.txt:
     20        * web-platform-tests/wasm/jsapi/idlharness.any.worker-expected.txt:
     21        * web-platform-tests/wasm/jsapi/interface.any.js:
     22        * web-platform-tests/wasm/jsapi/table/constructor.any-expected.txt:
     23        * web-platform-tests/wasm/jsapi/table/constructor.any.js:
     24        (test):
     25        * web-platform-tests/wasm/jsapi/table/constructor.any.worker-expected.txt:
     26
    1272022-01-15  Alan Bujtas  <zalan@apple.com>
    228
  • trunk/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/idlharness.any-expected.txt

    r279385 r288064  
    6161PASS Table interface: operation grow(unsigned long, optional any)
    6262PASS Table interface: operation get(unsigned long)
    63 FAIL Table interface: operation set(unsigned long, optional any) assert_equals: property has wrong .length expected 1 but got 2
     63PASS Table interface: operation set(unsigned long, optional any)
    6464PASS Table interface: attribute length
    6565PASS Global interface: existence and properties of interface object
  • trunk/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/idlharness.any.worker-expected.txt

    r279385 r288064  
    6161PASS Table interface: operation grow(unsigned long, optional any)
    6262PASS Table interface: operation get(unsigned long)
    63 FAIL Table interface: operation set(unsigned long, optional any) assert_equals: property has wrong .length expected 1 but got 2
     63PASS Table interface: operation set(unsigned long, optional any)
    6464PASS Table interface: attribute length
    6565PASS Global interface: existence and properties of interface object
  • trunk/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/interface.any.js

    r262312 r288064  
    144144  ["grow", 1],
    145145  ["get", 1],
    146   ["set", 2],
     146  ["set", 1],
    147147]);
    148148
  • trunk/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/constructor.any-expected.txt

    r288049 r288064  
    2323PASS Basic (zero)
    2424PASS Basic (non-zero)
    25 FAIL Stray argument WebAssembly.Table.prototype.constructor expects the second argument to be null or an instance of WebAssembly.Function
     25PASS Stray argument
    2626PASS Proxy descriptor
    2727PASS Type conversion for descriptor.element
  • trunk/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/constructor.any.js

    r288049 r288064  
    9090test(() => {
    9191  const argument = { "element": "anyfunc", "initial": 0 };
    92   const table = new WebAssembly.Table(argument, {});
     92  const table = new WebAssembly.Table(argument, null, {});
    9393  assert_Table(table, { "length": 0 });
    9494}, "Stray argument");
  • trunk/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/constructor.any.worker-expected.txt

    r288049 r288064  
    2323PASS Basic (zero)
    2424PASS Basic (non-zero)
    25 FAIL Stray argument WebAssembly.Table.prototype.constructor expects the second argument to be null or an instance of WebAssembly.Function
     25PASS Stray argument
    2626PASS Proxy descriptor
    2727PASS Type conversion for descriptor.element
  • trunk/Source/JavaScriptCore/ChangeLog

    r288050 r288064  
     12022-01-15  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        [JSC] Fix misc WebAssembly.Table issues
     4        https://bugs.webkit.org/show_bug.cgi?id=235262
     5
     6        Reviewed by Alexey Shvayka.
     7
     8        * wasm/js/WebAssemblyTablePrototype.cpp:
     9
    1102022-01-14  Yusuke Suzuki  <ysuzuki@apple.com> and Mikhail R. Gadelha  <mikhail@igalia.com>
    211
  • trunk/Source/JavaScriptCore/wasm/js/WebAssemblyTablePrototype.cpp

    r285730 r288064  
    5656 grow   webAssemblyTableProtoFuncGrow   Function 1
    5757 get    webAssemblyTableProtoFuncGet    Function 1
    58  set    webAssemblyTableProtoFuncSet    Function 2
     58 set    webAssemblyTableProtoFuncSet    Function 1
    5959 type   webAssemblyTableProtoFuncType   Function 0
    6060 @end
Note: See TracChangeset for help on using the changeset viewer.