Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"this" loses context when calling a function assigned to a variable. #18

Open
ZaneDubya opened this issue Jun 23, 2015 · 0 comments
Open

Comments

@ZaneDubya
Copy link
Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant