Skip to content

Commit

Permalink
Removing prefix check (undefined); renaming test to be more accurate
Browse files Browse the repository at this point in the history
  • Loading branch information
jimfleming committed Jun 17, 2014
1 parent 8e6cb64 commit a06d8cb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions lib/rewrite.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,6 @@ function match(wildcards, pattern, node) {
if (pattern.operator != node.operator) {
return false;
}
if (pattern.prefix != node.prefix) {
return false;
}
return match(wildcards, pattern.argument, node.argument);
case 'ArrayExpression':
return partial(wildcards, pattern.elements, node.elements);
Expand Down
2 changes: 1 addition & 1 deletion tests/rewrite.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('jsfmt.rewrite', function() {
.toString().should.eql('function test() { return [\n 0,\n 1,\n 2\n].map(function (val) {\n return val * val;\n}); }');
});

it('should be able to search for unary expression', function() {
it('should be able to rewrite unary expression', function() {
jsfmt.rewrite('var test = !0;', '!0 -> true').toString().should.eql('var test = true;');
jsfmt.rewrite('var test = !0;', '!0 -> !1').toString().should.eql('var test = !1;');
});
Expand Down

0 comments on commit a06d8cb

Please sign in to comment.