diff options
Diffstat (limited to 'testing/web-platform/tests/wasm/jsapi/function/call.tentative.any.js')
-rw-r--r-- | testing/web-platform/tests/wasm/jsapi/function/call.tentative.any.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/testing/web-platform/tests/wasm/jsapi/function/call.tentative.any.js b/testing/web-platform/tests/wasm/jsapi/function/call.tentative.any.js new file mode 100644 index 0000000000..2e63d5fa10 --- /dev/null +++ b/testing/web-platform/tests/wasm/jsapi/function/call.tentative.any.js @@ -0,0 +1,16 @@ +// META: global=window,dedicatedworker,jsshell,shadowrealm +// META: script=/wasm/jsapi/assertions.js + +function addxy(x, y) { + return x + y +} + +test(() => { + var fun = new WebAssembly.Function({parameters: ["i32", "i32"], results: ["i32"]}, addxy); + assert_equals(fun(1, 2), 3) +}, "test calling function") + +test(() => { + var fun = new WebAssembly.Function({parameters: ["i32", "i32"], results: ["i32"]}, addxy); + assert_throws_js(TypeError, () => new fun(1, 2)); +}, "test constructing function"); |