Skip to content

Commit dcf33a0

Browse files
committed
WASM: improve error message in case of symbol import problems
1 parent 7e66ff6 commit dcf33a0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

wasm/quick-lint-js.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ class Process {
108108
this._wasmInstance = wasmInstance;
109109

110110
function wrap(name) {
111+
if (!Object.prototype.hasOwnProperty.call(wasmInstance.exports, name)) {
112+
throw new TypeError(`WASM does not export function: ${name}`);
113+
}
111114
let func = wasmInstance.exports[name];
112115
return (...args) => {
113116
exports.maybeInjectFault(name);

0 commit comments

Comments
 (0)