From 3c12178f79f829798292f8eb7910c2c3402ed8f1 Mon Sep 17 00:00:00 2001 From: herr kaste Date: Tue, 2 Feb 2016 23:45:28 +0100 Subject: [PATCH] Proper implementation Replace ad hoc hack with a proper implementation. --- src/standard/annotations.html | 7 ++----- src/standard/effectBuilder.html | 8 ++++++++ test/unit/bind.html | 4 ++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/standard/annotations.html b/src/standard/annotations.html index 7ec8548f..8c14137f 100644 --- a/src/standard/annotations.html +++ b/src/standard/annotations.html @@ -147,11 +147,8 @@ TODO(sjmiles): this module should produce either syntactic metadata if (!p.literal) { var signature = this._parseMethod(p.value); if (signature) { - var method = signature.method; - if (this.properties[method]) { - var args = signature.args || []; - args.push(this._parseArg(method)); - signature.args = args; + if (this.properties[signature.method]) { + signature.dynamicFn = true; signature.static = false; } p.signature = signature; diff --git a/src/standard/effectBuilder.html b/src/standard/effectBuilder.html index 493a7c12..03635275 100644 --- a/src/standard/effectBuilder.html +++ b/src/standard/effectBuilder.html @@ -171,6 +171,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN arg); } } + if (sig.dynamicFn) { + // trigger=null is sufficient as long as we don't allow paths to be + // used. If we change our mind, we must first implement this in the + // effects anyway where we basically do a `fn = this[methodName]` at + // the moment. + this.__addAnnotatedComputationEffect( + sig.method, index, note, part, null); + } } }, diff --git a/test/unit/bind.html b/test/unit/bind.html index 752b5cfe..c13ed6fc 100644 --- a/test/unit/bind.html +++ b/test/unit/bind.html @@ -285,7 +285,7 @@ suite('single-element binding effects', function() {