[js-api] Fix more editorial slips #2278
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 535 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.376
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #2278"
general
weight: 0.35
Ms2ger
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: