In _notifyListener, only use e.detail if the event has a detail. This is necessary for ::eventName compatibility where eventName is a native event like change.

This commit is contained in:
Steven Orvell 2015-11-09 17:10:56 -08:00
parent 139257ba44
commit 3ece552db5
2 changed files with 6 additions and 3 deletions

View File

@ -179,8 +179,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
// 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 {

View File

@ -257,7 +257,7 @@ suite('single-element binding effects', function() {
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');
});