Skip to content

Commit

Permalink
Merge pull request gotwarlost#427 from alexdunphy/master
Browse files Browse the repository at this point in the history
  • Loading branch information
gotwarlost committed Aug 30, 2015
2 parents d638668 + 6b5fc28 commit a77029b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions lib/instrumenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@
pushAll(childArray, assignNode.prepend);
delete assignNode.prepend;
}
} else {
assignNode = undefined;
}
pushAll(childArray, assignNode);
}
Expand Down
6 changes: 3 additions & 3 deletions test/instrumentation/test-expressions.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ module.exports = {
"with an array expression with empty positions": {
setUp: function (cb) {
code = [
'var x = [, , args[0], ];',
'output = x.indexOf(args[0]) === x.length - 1;'
'var x = [args[0], , args[1], ];',
'output = x.indexOf(args[1]) === x.length - 1 && x[0] !== x[1];'
];
verifier = helper.verifier(__filename, code);
cb();
},

"should not barf in any way": function (test) {
verifier.verify(test, [ 5 ], true, { lines: { 1: 1, 2: 1 }, branches: {}, functions: {}, statements: { '1': 1, '2': 1 } });
verifier.verify(test, [ 1, 5 ], true, { lines: { 1: 1, 2: 1 }, branches: { 1: [ 1, 1 ]}, functions: {}, statements: { '1': 1, '2': 1 } });
test.done();
}
}
Expand Down

0 comments on commit a77029b

Please sign in to comment.