-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
https://github.com/ije/md4w/blob/main/js/md4w.js#L240-L246
if (wasmModule instanceof WebAssembly.Module) {
const instance = new WebAssembly.Instance(wasmModule, { env });
wasm = instance.exports;
} else if (wasmModule.default && wasmModule.allocMem) {
// unwasm specific
wasmModule.default(env);
wasm = wasmModule;
} // There is no Else and it falls through and never initalizesThere should be am else here or maybe even a throw of some sort yes?
Both of these conditional statements fail to meet the conditions for some of our users. Which makes the const wasm; never be set.
This causes errors to be thrown later. Specifically here
https://github.com/ije/md4w/blob/main/js/md4w.js#L154-L160
const ptrLen = wasm.render(
allocMem(data),
validateParseFlags(options.parseFlags),
Math.max(estHtmlSize, 512),
typeof highlighter === "function" ? 1 : 0,
renderer,
);
Metadata
Metadata
Assignees
Labels
No labels