googlearchive / TemplateBinding

TemplateBinding Prolyfill
290 stars 61 forks source link

TemplateIterator does not share any APIs of NodeBinding #147

Open jmesserly opened 10 years ago

jmesserly commented 10 years ago

Not sure if this is a bug, or an intentional design tradeoff, but:

The NodeBinding type, typically accessible via Node.bindings has various APIs such as:

In contrast TemplateElement.bind returns a TemplateIterator. It does not have any of those properties. Indeed, it cannot, as the same instance is shared by if/bind/repeat. (Is that for performance reasons?).

A few issues here:

jmesserly commented 10 years ago

Another issue with this:

// Normally calling .close will only close that binding.
// However this will close the TemplateIterator, including the "bind" and "repeat"
template.bindings['if'].close();