<div data-html="some_state_var">text to be overwritten</div>
The reason is, in walk.js, var nodes = [].slice.call(el.childNodes) BEFORE process(el, next), which causes the nodes array to contain [TextNode('text to be overwritten')]. Once next() is called, however, that TextNode is now an orphan, having been removed through the data-html binding. On most browsers, this causes no problems. On IE9 however, it causes an Invalid Argument error when accessing el.data from index.js:270.
There is a larger problem here: the reactive bindings processing of deleted nodes, via data-html or otherwise. Two solutions exist:
Never process deleted nodes. Test for el.parentNode and skip. (THIS PULL REQUEST)
Process new nodes set by data-html and other bindings. This has a unique side effect: data-html and similar bindings can now insert reactive-processed html. So this is now possible:
In IE9, the following template will error:
The reason is, in walk.js,
var nodes = [].slice.call(el.childNodes)
BEFOREprocess(el, next)
, which causes thenodes
array to contain[TextNode('text to be overwritten')]
. Oncenext()
is called, however, thatTextNode
is now an orphan, having been removed through thedata-html
binding. On most browsers, this causes no problems. On IE9 however, it causes anInvalid Argument
error when accessingel.data
from index.js:270.There is a larger problem here: the reactive bindings processing of deleted nodes, via
data-html
or otherwise. Two solutions exist:el.parentNode
and skip. (THIS PULL REQUEST)data-html
and other bindings. This has a unique side effect:data-html
and similar bindings can now insert reactive-processed html. So this is now possible:Thus, its clear that the right answer (to me anyway) is to not process deleted nodes.