@xmldom/xmldom
Advanced tools
Comparing version 0.7.12 to 0.7.13
@@ -7,2 +7,11 @@ # Changelog | ||
## [0.7.13](https://github.com/xmldom/xmldom/compare/0.7.12...0.7.13) | ||
### Fixed | ||
- dom: prevent iteration over deleted items [`#514`](https://github.com/xmldom/xmldom/pull/514)/ [`#499`](https://github.com/xmldom/xmldom/issues/499) | ||
Thank you, [@qtow](https://github.com/qtow), for your contributions | ||
## [0.7.12](https://github.com/xmldom/xmldom/compare/0.7.11...0.7.12) | ||
@@ -9,0 +18,0 @@ |
@@ -172,3 +172,3 @@ var conventions = require("./conventions"); | ||
item: function(index) { | ||
return this[index] || null; | ||
return index >= 0 && index < this.length ? this[index] : null; | ||
}, | ||
@@ -206,6 +206,12 @@ toString:function(isHTML,nodeFilter){ | ||
var inc = list._node._inc || list._node.ownerDocument._inc; | ||
if(list._inc != inc){ | ||
if (list._inc !== inc) { | ||
var ls = list._refresh(list._node); | ||
//console.log(ls.length) | ||
__set__(list,'length',ls.length); | ||
if (!list.$$length || ls.length < list.$$length) { | ||
for (var i = ls.length; i in list; i++) { | ||
if (Object.prototype.hasOwnProperty.call(list, i)) { | ||
delete list[i]; | ||
} | ||
} | ||
} | ||
copy(ls,list); | ||
@@ -217,3 +223,3 @@ list._inc = inc; | ||
_updateLiveList(this); | ||
return this[i]; | ||
return this[i] || null; | ||
} | ||
@@ -220,0 +226,0 @@ |
{ | ||
"name": "@xmldom/xmldom", | ||
"version": "0.7.12", | ||
"version": "0.7.13", | ||
"description": "A pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
168787
4949
45
1
2
1
9