Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing jsapi tests for wasm reference-types proposal #27099

Merged

Conversation

dbezhetskov
Copy link

The WebAssembly reference types proposal adds optional initializing parameter for Table.ctor, Table.grow js apis and makes the second parameter for Table.set optional.
The link to the spec: https://webassembly.github.io/reference-types/js-api/index.html#tables.

We already have tests for Table.grow but tests for Table.ctor and Table.set are missed.
This PR adds these missing tests.

Copy link
Contributor

@Ms2ger Ms2ger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

wasm/jsapi/table/constructor-reftypes.tentative.any.js Outdated Show resolved Hide resolved
wasm/jsapi/table/constructor-reftypes.tentative.any.js Outdated Show resolved Hide resolved
wasm/jsapi/table/constructor-reftypes.tentative.any.js Outdated Show resolved Hide resolved
wasm/jsapi/table/constructor-reftypes.tentative.any.js Outdated Show resolved Hide resolved
wasm/jsapi/table/set-reftypes.tentative.any.js Outdated Show resolved Hide resolved
wasm/jsapi/table/set-reftypes.tentative.any.js Outdated Show resolved Hide resolved
Copy link
Contributor

@Ms2ger Ms2ger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment on lines +23 to +26
test(() => {
const argument = { "element": "i32", "initial": 3 };
assert_throws_js(TypeError, () => new WebAssembly.Table(argument));
}, "initialize table with a wrong element value");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realized I haven't actually specced this behaviour. Will fix.

@Ms2ger Ms2ger merged commit 74cea76 into web-platform-tests:master Jan 14, 2021
@@ -0,0 +1,49 @@
// META: global=window,dedicatedworker,jsshell
// META: script=assertions.js
// META: script=/wasm/jsapi/wasm-constants.js
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this intentional? I'm not seeing a wasm-constants.js file in this location?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, this was removed in #16326. Will fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants