WebAssembly / WebAssembly/spec

js-api tests for externref

Open
#1,620 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
WebAssembly
Stars
3.5k
Forks
539
Avg merge
2d 1h
Merged PRs (30d)
13

Description

I'm trying to find (and add?) tests for init arguments for Table/Global constructors/methods that were introduced by reference-types proposal.

The https://webassembly.github.io/spec/js-api/index.html#dom-table-table defines the initial ref value to be ToWebAssemblyValue(undefined, externref), which is resolved to some ref.extern (not null).

Is this a mistake and the above default value has to be null? If it is not a mistake, what the following test must produce?

  const argument = { "element": "externref", "initial": 3 };
  const table = new WebAssembly.Table(argument);
  assert_equals(table.length, 3);
  assert_equals(table.get(0), null); // ??

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin with the JS API specification's Table definition and its reference to ToWebAssemblyValue(undefined, externref); compare the stated default with the expected Table.get(0) behavior and related Table/Global constructor and method cases. The issue is complete when the externref expectation is resolved and the corresponding js-api tests and specification behavior agree.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, wasm
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.