Skip to content

Commit

Permalink
In _notifyListener, only use e.detail if the event has a detail. …
Browse files Browse the repository at this point in the history
…This is necessary for `::eventName` compatibility where `eventName` is a native event like `change`.
  • Loading branch information
Steven Orvell committed Nov 10, 2015
1 parent 139257b commit 3ece552
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/standard/configure.html
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,11 @@
// handling is queue/defered until then.
_notifyListener: function(fn, e) {
if (!Polymer.Bind._isEventBogus(e, e.target)) {
var value = e.detail.value;
var path = e.detail.path;
var value, path;
if (e.detail) {
value = e.detail.value;
path = e.detail.path;
}
if (!this._clientsReadied) {
this._queueHandler([fn, e.target, value, path]);
} else {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/bind.html
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@
test('custom notification event to path', function() {
el.clearObserverCounts();
el.$.boundChild.customEventObjectValue = 84;
el.fire('change', null, {node: el.$.boundChild});
el.$.boundChild.dispatchEvent(new Event('change'));
assert.equal(el.customEventObject.value, 84, 'custom bound path incorrect');
assert.equal(el.observerCounts.customEventObjectValueChanged, 1, 'custom bound path observer not called');
});
Expand Down

0 comments on commit 3ece552

Please sign in to comment.