Skip to content

Commit

Permalink
Revert "Fix _patchMatchesEffect. (#3631)"
Browse files Browse the repository at this point in the history
This reverts commit b78e5af b/c
it is included in the Path module.
  • Loading branch information
kaste committed Jul 23, 2016
1 parent 43955ea commit a64f227
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 33 deletions.
2 changes: 1 addition & 1 deletion src/standard/notify-path.html
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@
var effectArg = effect.trigger.name;
return (effectArg == path) ||
(effectArg.indexOf(path + '.') === 0) ||
(effect.trigger.wildcard && path.indexOf(effectArg + '.') === 0);
(effect.trigger.wildcard && path.indexOf(effectArg) === 0);
},

/**
Expand Down
32 changes: 0 additions & 32 deletions test/unit/notify-path.html
Original file line number Diff line number Diff line change
Expand Up @@ -950,38 +950,6 @@
arraysEqual(el.array, [-1, 99, 2, 3]);
});

test('patch matches effect', function() {
var effect = {
trigger: {
name: 'foo.bar'
}
};

assert.isTrue(el._pathMatchesEffect('foo', effect));
assert.isTrue(el._pathMatchesEffect('foo.bar', effect));

assert.notOk(el._pathMatchesEffect('bar', effect));
assert.notOk(el._pathMatchesEffect('foobar', effect));
assert.notOk(el._pathMatchesEffect('foo.bar.baz', effect));
assert.notOk(el._pathMatchesEffect('foo.baz', effect));

effect = {
trigger: {
name: 'foo.bar',
wildcard: true
}
};

assert.isTrue(el._pathMatchesEffect('foo', effect));
assert.isTrue(el._pathMatchesEffect('foo.bar', effect));
assert.isTrue(el._pathMatchesEffect('foo.bar.baz', effect));

assert.notOk(el._pathMatchesEffect('foobar', effect));
assert.notOk(el._pathMatchesEffect('foo.bars', effect));
assert.notOk(el._pathMatchesEffect('foo.baz', effect));

});

});

suite('malformed observers', function() {
Expand Down

0 comments on commit a64f227

Please sign in to comment.