The wasm-bindgen JS shim's namespace.
OptionalinstanceExports: unknown
What initSync() / the shim's default() returned —
the instantiated .wasm exports. Checking the namespace alone is not
enough for a MIXED artifact (only one of luxar_wasm.js /
luxar_wasm_bg.wasm overwritten): the shim declares a static wrapper per
kernel, so its namespace reads as complete while the binary behind it
predates the kernel, and instantiation still succeeds because WebAssembly
only links imports. Omit it (or pass a non-object) to check the namespace
alone.
Reject a module that imported and initialised fine but predates one of the
REQUIRED_WASM_EXPORTSkernels. The list itself lives in./required-exports.tsbecause the vitest global setup shares it; see the comment there for why it is a separate module.make build-wasmis the fix for a genuinely stale build, but the two caller classes react to a failed check very differently:src/tests/helpers/wasm-artifact.ts) lets it throw — there is no fallback there, and failing loudly by name is the whole point.initWasm calls this before handing the module out, so the runtime path is covered. Tests, benchmarks and tools that want the compiled kernels load the built artifact themselves —
await import('.../public/wasm/ luxar_wasm.js')+initSync(), bypassinginitWasm— and get this check from the ONE loader they all share,src/tests/helpers/wasm-artifact.ts. That loader calls it before theas unknown as WasmModulecast (the double cast promises the entire interface while the artifact may be missing half of it, so a stale gitignored build otherwise surfaces as an opaque "x is not a function" from whichever kernel assertion runs first) and OUTSIDE the catch that downgrades a load failure to a skip (inside it, the named message would be swallowed too).direct-import-guard.test.tspins exactly one rule to keep that true: no source outside that helper may load the artifact itself — it fails on any other.tsundersrc/,tools/orscripts/that both mentionsluxar_wasm.jsand callsinitSync(.initWasm is the one deliberate exception to the placement rule: it calls this INSIDE the try whose catch returns a TypeScriptFallback, because entering the documented fallback is the right response to a stale build on the runtime path. The guard test exempts this module for that reason.