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) {
|
if (!p.literal) {
|
||||||
var signature = this._parseMethod(p.value);
|
var signature = this._parseMethod(p.value);
|
||||||
if (signature) {
|
if (signature) {
|
||||||
var method = signature.method;
|
if (this.properties[signature.method]) {
|
||||||
if (this.properties[method]) {
|
signature.dynamicFn = true;
|
||||||
var args = signature.args || [];
|
|
||||||
args.push(this._parseArg(method));
|
|
||||||
signature.args = args;
|
|
||||||
signature.static = false;
|
signature.static = false;
|
||||||
}
|
}
|
||||||
p.signature = signature;
|
p.signature = signature;
|
||||||
|
@ -171,6 +171,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||||||
arg);
|
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>
|
<script>
|
||||||
|
|
||||||
suite('computed properties', function() {
|
suite('computed bindings with dynamic functions', function() {
|
||||||
|
|
||||||
var el;
|
var el;
|
||||||
|
|
||||||
@ -297,7 +297,7 @@ suite('computed properties', function() {
|
|||||||
document.body.removeChild(el);
|
document.body.removeChild(el);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('x', function() {
|
test('annotated computation with dynamic function', function() {
|
||||||
el = document.createElement('x-bind-computed-property');
|
el = document.createElement('x-bind-computed-property');
|
||||||
document.body.appendChild(el);
|
document.body.appendChild(el);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user