|
33 | 33 | Polymer.Base._addFeature({
|
34 | 34 |
|
35 | 35 | _addPropertyEffect: function(property, kind, effect) {
|
36 |
| - // TODO(sjmiles): everything to the right of the first '.' is lost, implies |
37 |
| - // there is some duplicate information flow (not the only sign) |
38 |
| - var model = property.split('.').shift(); |
39 |
| - Polymer.Bind.addPropertyEffect(this, model, kind, effect); |
| 36 | + Polymer.Bind.addPropertyEffect(this, property, kind, effect); |
40 | 37 | },
|
41 | 38 |
|
42 | 39 | // prototyping
|
|
79 | 76 | if (m) {
|
80 | 77 | return {
|
81 | 78 | method: m[1],
|
82 |
| - args: m[2].split(/[^\w.*]+/).map(this._parseArg) |
| 79 | + args: m[2].split(/[^\w.*]+/).map(this._parseArg, this) |
83 | 80 | };
|
84 | 81 | }
|
85 | 82 | },
|
86 | 83 |
|
87 | 84 | _parseArg: function(arg) {
|
88 |
| - var a = { name: arg }; |
| 85 | + var a = { |
| 86 | + name: arg, |
| 87 | + model: this._modelForPath(arg) |
| 88 | + }; |
89 | 89 | a.structured = arg.indexOf('.') > 0;
|
90 | 90 | if (a.structured) {
|
91 | 91 | a.wildcard = (arg.slice(-2) == '.*');
|
|
99 | 99 | _addComputedEffect: function(name, expression) {
|
100 | 100 | var sig = this._parseMethod(expression);
|
101 | 101 | sig.args.forEach(function(arg) {
|
102 |
| - this._addPropertyEffect(arg.name, 'compute', { |
| 102 | + this._addPropertyEffect(arg.model, 'compute', { |
103 | 103 | method: sig.method,
|
104 | 104 | args: sig.args,
|
105 | 105 | arg: arg,
|
|
126 | 126 | _addComplexObserverEffect: function(observer) {
|
127 | 127 | var sig = this._parseMethod(observer);
|
128 | 128 | sig.args.forEach(function(arg) {
|
129 |
| - this._addPropertyEffect(arg.name, 'complexObserver', { |
| 129 | + this._addPropertyEffect(arg.model, 'complexObserver', { |
130 | 130 | method: sig.method,
|
131 | 131 | args: sig.args,
|
132 | 132 | arg: arg
|
|
154 | 154 | Polymer.Bind._addAnnotatedListener(this, index,
|
155 | 155 | note.name, note.value, note.event);
|
156 | 156 | }
|
157 |
| - var sig = this._parseMethod(note.value); |
158 |
| - if (sig) { |
159 |
| - this._addAnnotatedComputationEffect(sig, note, index); |
| 157 | + if (note.signature) { |
| 158 | + this._addAnnotatedComputationEffect(note, index); |
160 | 159 | } else {
|
161 | 160 | // capture the node index
|
162 | 161 | note.index = index;
|
163 |
| - // discover top-level property (model) from path |
164 |
| - var model = note.value.split('.').shift(); |
165 | 162 | // add 'annotation' binding effect for property 'model'
|
166 |
| - this._addPropertyEffect(model, 'annotation', note); |
| 163 | + this._addPropertyEffect(note.model, 'annotation', note); |
167 | 164 | }
|
168 | 165 | },
|
169 | 166 |
|
170 |
| - _addAnnotatedComputationEffect: function(sig, note, index) { |
| 167 | + _addAnnotatedComputationEffect: function(note, index) { |
| 168 | + var sig = note.signature; |
171 | 169 | sig.args.forEach(function(arg) {
|
172 |
| - this._addPropertyEffect(arg.name, 'annotatedComputation', { |
| 170 | + this._addPropertyEffect(arg.model, 'annotatedComputation', { |
173 | 171 | kind: note.kind,
|
174 | 172 | method: sig.method,
|
175 | 173 | args: sig.args,
|
|
0 commit comments