Open guymguym opened 6 years ago
+1, just ran into this issue while updating our code coverage tool.
The syntax where you assign a default value inside destructuring of an object seems to trigger this. Not great, but to work around you'd have to instead of
const { field: value = 0 } = object;
do
const {field : value} = object; value = value || 0;
@AngryPidgeon You best upgrade to use https://github.com/istanbuljs/nyc instead of this deprecated repo. It has not been active for 2 years now (see comment in readme)
@guymguym thanks, I'll look into that. (I did get Istanbul working fine, but better to be update)
This code:
Works on node v6:
Fails on istanbul 0.4.5:
Here is the instrumented code:
This statement was malformed: