OLD | NEW |
1 <!-- | 1 <!-- |
2 // Copyright 2014 The Chromium Authors. All rights reserved. | 2 // Copyright 2014 The Chromium Authors. All rights reserved. |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 --> | 5 --> |
6 <import src="observe.sky" as="observe" /> | 6 <import src="observe.sky" as="observe" /> |
7 | 7 |
8 <script> | 8 <script> |
9 Node.prototype.bind = function(name, observable, oneTime) { | 9 Node.prototype.bind = function(name, observable, oneTime) { |
10 var self = this; | 10 var self = this; |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 Object.getOwnPropertyNames(from).forEach(function(name) { | 130 Object.getOwnPropertyNames(from).forEach(function(name) { |
131 Object.defineProperty(to, name, | 131 Object.defineProperty(to, name, |
132 Object.getOwnPropertyDescriptor(from, name)); | 132 Object.getOwnPropertyDescriptor(from, name)); |
133 }); | 133 }); |
134 } | 134 } |
135 | 135 |
136 function getTemplateStagingDocument(template) { | 136 function getTemplateStagingDocument(template) { |
137 if (!template.stagingDocument_) { | 137 if (!template.stagingDocument_) { |
138 var owner = template.ownerDocument; | 138 var owner = template.ownerDocument; |
139 if (!owner.stagingDocument_) { | 139 if (!owner.stagingDocument_) { |
140 owner.stagingDocument_ = owner.implementation.createDocument(''); | 140 // FIXME(sky): Does this need to create a Document without a registration |
| 141 // context? |
| 142 owner.stagingDocument_ = new Document(); |
141 owner.stagingDocument_.isStagingDocument = true; | 143 owner.stagingDocument_.isStagingDocument = true; |
142 owner.stagingDocument_.stagingDocument_ = owner.stagingDocument_; | 144 owner.stagingDocument_.stagingDocument_ = owner.stagingDocument_; |
143 } | 145 } |
144 | 146 |
145 template.stagingDocument_ = owner.stagingDocument_; | 147 template.stagingDocument_ = owner.stagingDocument_; |
146 } | 148 } |
147 | 149 |
148 return template.stagingDocument_; | 150 return template.stagingDocument_; |
149 } | 151 } |
150 | 152 |
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
995 this.closeInstanceBindings(this.instances[i]); | 997 this.closeInstanceBindings(this.instances[i]); |
996 } | 998 } |
997 | 999 |
998 this.instances.length = 0; | 1000 this.instances.length = 0; |
999 this.closeDeps(); | 1001 this.closeDeps(); |
1000 this.templateElement_.iterator_ = undefined; | 1002 this.templateElement_.iterator_ = undefined; |
1001 this.closed = true; | 1003 this.closed = true; |
1002 } | 1004 } |
1003 }; | 1005 }; |
1004 </script> | 1006 </script> |
OLD | NEW |