Skip to content
This repository was archived by the owner on Oct 9, 2018. It is now read-only.

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andreyvit
Copy link

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.

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.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant