mirror of
https://github.com/hanzoai/quickjs-emscripten.git
synced 2026-10-30 19:37:29 +00:00
* working wrangler demo * improve worker example code quality * add helpers for cloudflare support * document cloudflare, deno, esmodule * deno smoketest file * doc cleanup * expand loader docs * test minimal example in CI * rebuild docs * document minimal size
17 lines
651 B
JavaScript
17 lines
651 B
JavaScript
/* eslint-disable no-undef */
|
|
// quickjs-emscripten code injected into emscripten-module.js
|
|
// We use this to expose and patch up issues with Emscripten's source map handling...
|
|
function quickjsEmscriptenInit(debugLog) {
|
|
const log = debugLog || function () {}
|
|
// Everything goes in a function so we can defer running until other variables
|
|
// are initialized in case they change.
|
|
const extension = { log }
|
|
for (const init of quickjsEmscriptenInit.inits) {
|
|
init(extension)
|
|
}
|
|
Module["quickJSEmscriptenExtensions"] = extension
|
|
return extension
|
|
}
|
|
quickjsEmscriptenInit.inits = []
|
|
Module["quickjsEmscriptenInit"] = quickjsEmscriptenInit
|