|
248 | 248 | Polymer.Bind._createAccessors(proto, parentProp, effects);
|
249 | 249 | }
|
250 | 250 | }
|
| 251 | + // capture this reference for use below |
| 252 | + var self = this; |
251 | 253 | // Instance setup
|
252 | 254 | if (template != this) {
|
253 | 255 | Polymer.Bind.prepareInstance(template);
|
254 |
| - var self = this; |
255 | 256 | template._forwardParentProp = function(source, value) {
|
256 | 257 | self._forwardParentProp(source, value);
|
257 | 258 | }
|
258 | 259 | }
|
259 | 260 | this._extendTemplate(template, proto);
|
260 |
| - var self = this; |
261 | 261 | template._pathEffector = function(path, value, fromAbove) {
|
262 | 262 | return self._pathEffectorImpl(path, value, fromAbove);
|
263 | 263 | }
|
|
332 | 332 | _constructorImpl: function(model, host) {
|
333 | 333 | this._rootDataHost = host._getRootDataHost();
|
334 | 334 | this._setupConfigure(model);
|
335 |
| - this._calcHost(host); |
336 |
| - this._beginHost(); |
| 335 | + this._registerHost(host); |
| 336 | + this._beginHosting(); |
337 | 337 | this.root = this.instanceTemplate(this._template);
|
338 | 338 | this.root.__noContent = !this._notes._hasContent;
|
339 | 339 | this.root.__styleScoped = true;
|
340 |
| - this._popHost(); |
| 340 | + this._endHosting(); |
341 | 341 | this._marshalAnnotatedNodes();
|
342 | 342 | this._marshalInstanceEffects();
|
343 | 343 | this._marshalAnnotatedListeners();
|
|
450 | 450 | }
|
451 | 451 | }
|
452 | 452 |
|
453 |
| - // TODO(sorvell): note, using the template as host is ~5-10% faster if |
454 |
| - // elements have no default values. |
455 |
| - // _constructorImpl: function(model, host) { |
456 |
| - // this._setupConfigure(model); |
457 |
| - // host._beginHost(); |
458 |
| - // this.root = this.instanceTemplate(this._template); |
459 |
| - // host._popHost(); |
460 |
| - // this._marshalTemplateContent(); |
461 |
| - // this._marshalAnnotatedNodes(); |
462 |
| - // this._marshalInstanceEffects(); |
463 |
| - // this._marshalAnnotatedListeners(); |
464 |
| - // this._ready(); |
465 |
| - // }, |
466 |
| - |
467 |
| - // stamp: function(model) { |
468 |
| - // return new this.ctor(model, this.dataHost); |
469 |
| - // } |
470 |
| - |
471 |
| - |
472 | 453 | };
|
473 | 454 |
|
474 | 455 | </script>
|
0 commit comments