Netjs
Netjs copied to clipboard
"this" loses context when calling a function assigned to a variable.
Func<List<string>, OpcodeFlag, ParserState, List<ushort>> assembler;
assembler = m_Opcodes[opcode.ToLowerInvariant()];
bool result = assembler(param, opcodeFlag, state);
After transpilation to typescript, any calls to "this." in the assigned "assembler" function will resolve to Window, not the calling class. I believe this is the same problem seen in this thread on Stack Overflow. If I knew more about javascript, I'd propose a fix for you - but I don't, so all I can offer is this issue.