Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
trap null delegates silently for bound events
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott J. Miles committed Apr 4, 2014
1 parent 1749343 commit b2bb1b4
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/polymer-expressions.js
Expand Up @@ -549,20 +549,21 @@
if (typeof polymerExpressions.resolveEventHandler == 'function') {
handler = function(e) {
fn = fn || polymerExpressions.resolveEventHandler(model, path, node);
fn(e, e.detail, e.currentTarget);

if (Platform && typeof Platform.flush == 'function')
Platform.flush();
if (fn) {
fn(e, e.detail, e.currentTarget);
if (Platform && typeof Platform.flush == 'function')
Platform.flush();
}
};
} else {
handler = function(e) {
fn = fn || path.getValueFrom(model);
receiver = receiver || resolveEventReceiver(model, path, node);

fn.apply(receiver, [e, e.detail, e.currentTarget]);

if (Platform && typeof Platform.flush == 'function')
Platform.flush();
if (fn) {
fn.apply(receiver, [e, e.detail, e.currentTarget]);
if (Platform && typeof Platform.flush == 'function')
Platform.flush();
}
};
}

Expand Down

0 comments on commit b2bb1b4

Please sign in to comment.