diff options
| author | Jieiku | 2022-09-20 17:34:19 -0700 |
|---|---|---|
| committer | Jieiku | 2022-09-20 17:34:19 -0700 |
| commit | 864a89104bd444fbebb9dcbe3ed853c28f8b21e7 (patch) | |
| tree | e9bd0165ac208d4b5ebe7ee2223c218f6ad78ed6 /static/tinysearch_engine.js | |
| parent | 7d691159df6e0f64129d3c11f4e8026dca3a72d1 (diff) | |
| download | abridge-864a89104bd444fbebb9dcbe3ed853c28f8b21e7.tar.gz abridge-864a89104bd444fbebb9dcbe3ed853c28f8b21e7.tar.bz2 abridge-864a89104bd444fbebb9dcbe3ed853c28f8b21e7.zip | |
Fix index generation when all pages in a section are drafts, closes #93
Diffstat (limited to 'static/tinysearch_engine.js')
| -rw-r--r-- | static/tinysearch_engine.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/static/tinysearch_engine.js b/static/tinysearch_engine.js index 180d3d9..7fa5084 100644 --- a/static/tinysearch_engine.js +++ b/static/tinysearch_engine.js @@ -168,12 +168,15 @@ function finalizeInit(instance, module) { return wasm; } -function initSync(bytes) { +function initSync(module) { const imports = getImports(); initMemory(imports); - const module = new WebAssembly.Module(bytes); + if (!(module instanceof WebAssembly.Module)) { + module = new WebAssembly.Module(module); + } + const instance = new WebAssembly.Instance(module, imports); return finalizeInit(instance, module); |
