Skip to content

Commit 15e3c4f

Browse files
committed
Add a setter for NodeList.length
Apparently, Firefox's `Array.prototype.splice` sets `length`. This fails without a setter, so add one that just returns the current value of `this._length`.
1 parent e7d4ec9 commit 15e3c4f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/jsdom/level1/core.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,9 @@ core.NodeList.prototype = {
233233
this._update();
234234
return this._length || 0;
235235
},
236+
set length(length) {
237+
return this._length;
238+
},
236239
item: function(index) {
237240
this._update();
238241
return this[index] || null;

0 commit comments

Comments
 (0)