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

Fix js-api tests #87

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/js-api/memory/constructor.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ test(() => {
}, "Memory with i32 index constructor");

test(() => {
const argument = { "initial": 1, "index": "i64" };
const argument = { "initial": 1n, "index": "i64" };
const memory = new WebAssembly.Memory(argument);
assert_Memory(memory, { "size": 1, "index": "i64" });
}, "Memory with i64 index constructor");
Expand Down
14 changes: 7 additions & 7 deletions test/js-api/table/constructor.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ test(() => {
get index() {
order.push("index");
return {
valueOf() {
order.push("index valueOf");
toString() {
order.push("index toString");
return "i32";
},
};
Expand All @@ -172,12 +172,12 @@ test(() => {
assert_array_equals(order, [
"element",
"element toString",
"index",
"index toString",
"initial",
"initial valueOf",
"maximum",
"maximum valueOf",
"index",
"index valueOf",
]);
}, "Order of evaluation for descriptor");

Expand Down Expand Up @@ -220,22 +220,22 @@ test(() => {
}, "initialize anyfunc table with a bad default value");

test(() => {
const argument = { "element": "i32", "initial": 3, "index": "i32" };
const argument = { "element": "anyfunc", "initial": 3, "index": "i32" };
const table = new WebAssembly.Table(argument);
// Once this is merged with the type reflection proposal we should check the
// index type of `table`.
assert_equals(table.length, 3);
}, "Table with i32 index constructor");

test(() => {
const argument = { "element": "i32", "initial": 3, "index": "i64" };
const argument = { "element": "anyfunc", "initial": 3n, "index": "i64" };
const table = new WebAssembly.Table(argument);
// Once this is merged with the type reflection proposal we should check the
// index type of `table`.
assert_equals(table.length, 3);
}, "Table with i64 index constructor");

test(() => {
const argument = { "element": "i32", "initial": 3, "index": "unknown" };
const argument = { "element": "anyfunc", "initial": 3, "index": "unknown" };
assert_throws_js(TypeError, () => new WebAssembly.Table(argument));
}, "Unknown table index");
Loading