|
279 | 279 | // construct `$` map (from id annotations)
|
280 | 280 | _marshalIdNodes: function() {
|
281 | 281 | this.$ = {};
|
282 |
| - this._notes.forEach(function(a) { |
| 282 | + for (var i=0, l=this._notes.length, a; (i<l) && (a=this._notes[i]); i++) { |
283 | 283 | if (a.id) {
|
284 | 284 | this.$[a.id] = this._findAnnotatedNode(this.root, a);
|
285 | 285 | }
|
286 |
| - }, this); |
| 286 | + } |
287 | 287 | },
|
288 | 288 |
|
289 | 289 | // concretize `_nodes` map (from anonymous annotations)
|
290 | 290 | _marshalAnnotatedNodes: function() {
|
291 |
| - if (this._nodes) { |
292 |
| - this._nodes = this._nodes.map(function(a) { |
293 |
| - return this._findAnnotatedNode(this.root, a); |
294 |
| - }, this); |
| 291 | + if (this._nodes && this._nodes.length) { |
| 292 | + var r = new Array(this._nodes.length); |
| 293 | + for (var i=0; i < this._nodes.length; i++) { |
| 294 | + r[i] = this._findAnnotatedNode(this.root, this._nodes[i]); |
| 295 | + } |
| 296 | + this._nodes = r; |
295 | 297 | }
|
296 | 298 | },
|
297 | 299 |
|
298 | 300 | // install event listeners (from event annotations)
|
299 | 301 | _marshalAnnotatedListeners: function() {
|
300 |
| - this._notes.forEach(function(a) { |
| 302 | + for (var i=0, l=this._nodes.length, a; (i<l) && (a=this._nodes[i]); i++) { |
301 | 303 | if (a.events && a.events.length) {
|
302 | 304 | var node = this._findAnnotatedNode(this.root, a);
|
303 |
| - a.events.forEach(function(e) { |
| 305 | + for (var j=0, e$=a.events, e; (j<e$.length) && (e=e$[j]); j++) { |
304 | 306 | this.listen(node, e.name, e.value);
|
305 |
| - }, this); |
| 307 | + } |
306 | 308 | }
|
307 |
| - }, this); |
| 309 | + } |
308 | 310 | }
|
309 | 311 |
|
310 | 312 | });
|
|
0 commit comments