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

Already on GitHub? Sign in to your account

Fix: instrumentation breaks `new(require('foo'))(args)` #19

Open
wants to merge 1 commit into
from

Conversation

Projects
None yet
1 participant

Fix a missing parenthesis when generating code for a new() statement applied to an expression, like the example:

new(require('foo'))(args)

which used to generate

new require('foo')(args)

resulting in the returned function being called without 'new'.

I have no idea why on earth TOK_LP calls instrument_function_call; it seems to treat all parethesized expressions as function calls, but I didn't feel like investigating that.

@andreyvit andreyvit Fix: instrumentation breaks "new(require('foo'))(args)"
Fix a missing parenthesis when generating code for a new() statement
applied to an expression, like the example:

    new(require('foo'))(args)

which used to generate

    new require('foo')(args)

resulting in the returned function being called without 'new'.

I have no idea why on earth TOK_LP calls instrument_function_call; it
seems to treat all parethesized expressions as function calls, but I
didn't feel like investigating that.
c7801a9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment