Commit 4fd2ad0
authored
Re-export HEAP* views on Module for embedders (#76)
Recent Emscripten (>=3.1.x) makes the HEAP{,U}{8,16,32} TypedArray
views module-local by default to help tree-shaking. The bundled
simple.js (and any other code that embeds the Binjgb factory)
reaches into module.HEAP8.buffer / module.HEAPU8 / etc. via
makeWasmBuffer; with the new default those accesses are undefined
and the first Emulator construction throws
"Cannot read properties of undefined (reading 'buffer')" before
the ROM even loads.
Add an explicit EXPORTED_RUNTIME_METHODS list so the wasm build
re-attaches these views to the Module object the way pre-3.1.x
Emscripten did by default. Also gitignore the `emscripten`
symlink that contributors create at the repo root per the README
build instructions.
docs/binjgb.{js,wasm} regenerated via `make demo` under
Emscripten 5.0.7.1 parent 9ff6e8a commit 4fd2ad0
4 files changed
Lines changed: 4 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| 164 | + | |
164 | 165 | | |
165 | 166 | | |
166 | 167 | | |
| |||
0 commit comments