node-jscoverage
node-jscoverage copied to clipboard
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.