mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-11 16:46:16 +00:00
Prepare asyncify support
This commit is contained in:
@@ -26,6 +26,12 @@ function logLine(text) {
|
||||
}
|
||||
}
|
||||
|
||||
function notifyExit(code) {
|
||||
flushLines();
|
||||
postMessage({ message: "end", data: code });
|
||||
self.close();
|
||||
}
|
||||
|
||||
function runEmulation(filesystem, file, options) {
|
||||
globalThis.Module = {
|
||||
arguments: [...options, "-e", "./root", file],
|
||||
@@ -46,12 +52,10 @@ function runEmulation(filesystem, file, options) {
|
||||
},
|
||||
print: logLine,
|
||||
printErr: logLine,
|
||||
postRun: () => {
|
||||
flushLines();
|
||||
postMessage({ message: "end", data: null });
|
||||
self.close();
|
||||
},
|
||||
onAbort: () => notifyExit(null),
|
||||
onExit: notifyExit,
|
||||
postRun: flushLines,
|
||||
};
|
||||
|
||||
importScripts("./analyzer.js?1");
|
||||
importScripts("./analyzer.js");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user