Skip to content

[test] assert_return should not assume it can stringify ref.array values #2010

@Ms2ger

Description

@Ms2ger

This fails in array_new_elem.wast.js, for example:

// array_new_elem.wast:18
assert_return(() => call($1, "array-new-elem", [0, 0]), "array_new_elem.wast:18", "ref.array");
#9 Test that a WebAssembly code returns a specific result (array_new_elem.wast:18)

can't convert actual[i] to string

assert_return/chain</<@http://web-platform.test:8000/wasm/core/js/harness/async_index.js:338:92
Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:2869:25
test@http://web-platform.test:8000/resources/testharness.js:633:30
uniqueTest@http://web-platform.test:8000/wasm/core/js/harness/async_index.js:27:7
assert_return/chain<@http://web-platform.test:8000/wasm/core/js/harness/async_index.js:310:19

with async_index.js:

[332]              case "ref.any":
[333]              case "ref.eq":
[334]              case "ref.struct":
[335]              case "ref.array":
[336]                // For now, JS can't distinguish exported Wasm GC values,
[337]                // so we only test for object.
[338]                assert_true(typeof actual[i] === "object", `expected Wasm GC object, got ${actual[i]}`);
[339]                return;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions