Repository navigation
[js-api] Fix more editorial slips - #2278
Merged
rossberg merged 1 commit intoOct 13, 2026
Merged
Conversation
Ms2ger
approved these changes
Oct 13, 2026
| 1. Let |wasmParameters| be «». | ||
| 1. [=list/iterate|For each=] |paramType| of |parameters|, | ||
| 1. [=list/Append=] [=ToValueType=](|paramType|) to |wasmParameters|. | ||
| 1. Let |tagtype| be the [=defined type=] such that [=comp-type/func=] |wasmParameters| → « » is the [=expansion=] of |tagtype|. |
Collaborator
There was a problem hiding this comment.
Pretty clunky, but alright.
Collaborator
|
I'm not sure what's up with the spectec CI, so I'll ask @rossberg to merge if it's benign. |
Member
|
Was a missing spec expectations update in an earlier push. Fixed now, I'll land your PRs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR makes a handful of small, unrelated editorial fixes bundled together,
which mostly come from the drift from the core Wasm spec.
1. Field access of table types and memory types
Memory.growandTable.lengtheach project a single field out ofmem_type/table_type's return value:This isn't technically wrong, but "the X in Y(...)" reads as projecting a named field,
when
mem_type/table_typeactually just return a plain tuple with no field names at all.Other call sites of
table_type(table.get/.set, theTableconstructor)instead destructure the full tuple, so rewritten to follow that pattern:
2.
limitsrepresented as a named-field record, which the Core Spec doesn't haveMemory/Table's constructors each build alimitsvalue as a named-field record:But the Core Spec's actual grammar (
limits ::= [u64 .. u64?]) is a range, not a two-field record.Rewritten directly to the grammar's own bracket-ellipsis notation:
(Side note: this also makes two tweaks on
memory type's own line:a leading "the", and the trailing
pagekeyword.)3. Global mutability represented with
const/var, which no longer existGlobal's constructor (and two other call sites) represent mutability with two named terms,constandvar:But the Core Spec's actual grammar (
globaltype ::= mut? valtype) represents mutability as an optional marker.Rewritten to match, using a new
mutterm for the present case and nothing at all for the absent one:(Side note: For
stringExternType, the entire term was written using backtick, which is now rewritten using linked terms.)4.
deftype/comptypeconversion at the Embedding API boundary, done implicitly instead of explicitlyBefore the GC proposal, a function's type simply was a
params -> resultsshape.GC introduced
deftype(a recursive-type wrapper that needs an explicitexpandto get back to that shape) and turnedcomptypeitself into a 3-variant sum (struct/array/func).Several call sites still destructure or construct a
deftype/comptypepair as if neither change happened:functype/tagtypearedeftypes, not already-expandedcomptypes.The Embedding API's own postcondition for both says so explicitly
("the returned defined type ... expands to a function type").
tag_alloc's argument requires adeftypetoo, not a barecomptypebut the bare arrow notation is passed directly.Separately, the arrow notation itself is missing the leading variant name,
func, thatcomptype's current 3-variant grammar requires.Rewritten using terms the Core Spec already has:
expansionfor the deftype→comptype direction,and "such that" idiom (already used by
ToWebAssemblyValue) for the inverse: