Merge pull request #4166 from Snarling/ns1wrapfix

NETSCRIPT: NS1 wrapper no longer fails to properly wrap some functions
This commit is contained in:
hydroflame 2022-09-27 14:36:27 -03:00 committed by GitHub
commit 8f4636cbb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -118,7 +118,7 @@ function startNetscript1Script(workerScript: WorkerScript): Promise<void> {
// See JSInterpreter.js:3209 // See JSInterpreter.js:3209
try { try {
const callback = args.pop() as (value: unknown) => void; const callback = args.pop() as (value: unknown) => void;
const result = await entry(...args.map(int.pseudoToNative)); const result = await entry(...args.map((arg) => int.pseudoToNative(arg)));
return callback(int.nativeToPseudo(result)); return callback(int.nativeToPseudo(result));
} catch (e: unknown) { } catch (e: unknown) {
// TODO: Unify error handling, this was stolen from previous async handler // TODO: Unify error handling, this was stolen from previous async handler