From 3ece552db50f0f1f951c34978b85840e7afce715 Mon Sep 17 00:00:00 2001 From: Steven Orvell Date: Mon, 9 Nov 2015 17:10:56 -0800 Subject: [PATCH] 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`. --- src/standard/configure.html | 7 +++++-- test/unit/bind.html | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/standard/configure.html b/src/standard/configure.html index 19fe67a110..c831abad49 100644 --- a/src/standard/configure.html +++ b/src/standard/configure.html @@ -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 { diff --git a/test/unit/bind.html b/test/unit/bind.html index 842b0073df..ce57c3ce07 100644 --- a/test/unit/bind.html +++ b/test/unit/bind.html @@ -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'); });