Skip to content

Commit

Permalink
rustwasm-wrapper: Workaround error "location is not defined"
Browse files Browse the repository at this point in the history
  • Loading branch information
j-devel committed Mar 17, 2023
1 parent f602b84 commit 6d3c54b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rustwasm-wrapper/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Mod {
const initJs = new TextDecoder().decode(Mod.getPkgJs());

// Create the 'pure' version of the wasm_bindgen's `init()`
const _init = (new Function(`return () => { ${initJs} return wasm_bindgen; };`))
const _init = (new Function(`return () => { const document = undefined; const location = {}; ${initJs} return wasm_bindgen; };`))
.call(null);

this._wbg = _init();
Expand Down

0 comments on commit 6d3c54b

Please sign in to comment.