mirror of
https://github.com/Polymer/polymer.git
synced 2025-02-25 18:55:30 -06:00
Proper implementation
Replace ad hoc hack with a proper implementation.
This commit is contained in:
parent
3f1bc4e33a
commit
3c12178f79
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -285,7 +285,7 @@ suite('single-element binding effects', function() {
|
||||
|
||||
<script>
|
||||
|
||||
suite('computed properties', function() {
|
||||
suite('computed bindings with dynamic functions', function() {
|
||||
|
||||
var el;
|
||||
|
||||
@ -297,7 +297,7 @@ suite('computed properties', function() {
|
||||
document.body.removeChild(el);
|
||||
});
|
||||
|
||||
test('x', function() {
|
||||
test('annotated computation with dynamic function', function() {
|
||||
el = document.createElement('x-bind-computed-property');
|
||||
document.body.appendChild(el);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user