[js-api] Give `WebAssemblyCompileOptions`'s members explicit default values #2276
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 189 lines diff across 2 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.314
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #2276"
general
weight: 0.35
Ms2ger
Three call sites (
validate(),asynchronously compile a WebAssembly module, and theModuleconstructor) read two members of the argumentoptionsunconditionally:options's IDL type,WebAssemblyCompileOptions, declares both as plain optional dictionary members with no default value:Per WebIDL's dictionary-conversion (and its own example of this exact case), such a member gets no entry at all when omitted, so for a call like
WebAssembly.compile(bytes)with no options, both lines above index into a map with neither key present. (A similar case, theMemory/Tableconstructors' own optional dictionary members, already guards against it)Therefore, this PR gives the dictionary expected default members, inferred from the use sites in
read the imports:(An alternative solution would be adding a guard at each of the three call sites, the way
Memory/Tabledo. But since these two defaults are static and don't depend on anything else in options, fixing it once at the dictionary declaration seemed cleaner than repeating the same guard three times.)