Is there a reliable way to detect if the interpreter a T3 game is running in is using emscripten/wasm under the hood?
Reason I ask is that after mentioning it in another thread I decided to clean up the simple interactive debugger code I wrote…only to discover that the runtime compiler behaves differently in interpreters that go through wasm.
Specifically, frobTADS and gargoyle, for example are happy to evaluate an expression like widget.propName = value, but e.g. emglken chucks a wobby if the expression isn’t wrapped in something like function() { widget.propName = value; }.
Unhandled Rejection: RuntimeError: null function or function signature mismatch
at CTcPrsOpUnary::parse_primary() (wasm://wasm/00c279c2:wasm-function[856]:0x128ab2)
at CTcPrsOpUnary::parse_postfix(int, int) (wasm://wasm/00c279c2:wasm-function[857]:0x12b409)
at CTcPrsOpUnary::parse() const (wasm://wasm/00c279c2:wasm-function[2302]:0x260c53)
at CTcPrsOpBinGroup::parse() const (wasm://wasm/00c279c2:wasm-function[2332]:0x26396a)
at CTcPrsOpBinGroup::parse() const (wasm://wasm/00c279c2:wasm-function[2332]:0x26396a)
at CTcPrsOpBinGroup::parse() const (wasm://wasm/00c279c2:wasm-function[2332]:0x26396a)
at CTcPrsOpBinGroup::parse() const (wasm://wasm/00c279c2:wasm-function[2332]:0x26396a)
at CTcPrsOpBinGroupCompare::parse() const (wasm://wasm/00c279c2:wasm-function[2331]:0x263124)
at CTcPrsOpBin::parse() const (wasm://wasm/00c279c2:wasm-function[553]:0xab97c)
at CTcPrsOpBin::parse() const (wasm://wasm/00c279c2:wasm-function[553]:0xab97c)
Works fine. But this is not supposed to be required. Or at least not according to the comments in dynfunc.t for the Compiler class, which explicitly say that the string passed to Compiler.compile() can be either an entire function declaration or a bare expression.
This now-fixed problem aside, is there any way of detecting emscripten interpreters at runtime? I got started thinking about it because the issue with compiling expressions, but I’m also sorta casting around for some way to do interpreter capability testing at runtime.
T3 provides some rudimentary capability testing via systemInfo(), but it actually provides very little information.