fix: add properties and methods to go wasm middleware, accessed via reflection
This commit is contained in:
parent
2aa53faf00
commit
53dd352c95
|
@ -82,6 +82,7 @@ export default class Go {
|
||||||
private exited = false;
|
private exited = false;
|
||||||
private _resolveCallbackPromise?: () => void;
|
private _resolveCallbackPromise?: () => void;
|
||||||
importObject: ImportObject;
|
importObject: ImportObject;
|
||||||
|
private _pendingEvent?: any;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this._callbackTimeouts = new Map();
|
this._callbackTimeouts = new Map();
|
||||||
|
@ -437,6 +438,16 @@ export default class Go {
|
||||||
}
|
}
|
||||||
this._inst.exports.resume();
|
this._inst.exports.resume();
|
||||||
}
|
}
|
||||||
|
_makeFuncWrapper(id) {
|
||||||
|
const go = this;
|
||||||
|
return function () {
|
||||||
|
const event = { id: id, this: this, args: arguments };
|
||||||
|
go._pendingEvent = event;
|
||||||
|
go._resume();
|
||||||
|
// @ts-ignore
|
||||||
|
return event.result;
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
|
Loading…
Reference in New Issue