jindw / xmldom

A PURE JS W3C Standard based(XML DOM Level2 CORE) DOMParser and XMLSerializer.
Other
819 stars 265 forks source link

replaceChild does not fail if oldnode is null. #230

Open akayami opened 6 years ago

akayami commented 6 years ago

node.replaceChild(document.createTextNode('a'), null); node.replaceChild(document.createTextNode('a'), null);

will result in in node having two textNodes with value 'a'.

Each call should fail instead of magically appending.