1
0
Fork 0

[spidermonkey] forEach and other Array methods for nodelist

This commit is contained in:
Witold Filipczyk 2024-05-06 18:40:02 +02:00
parent 15ac18c04f
commit 8bba9f8c4e
2 changed files with 9 additions and 1 deletions

View File

@ -82,7 +82,7 @@ JSClassOps nodeList_ops = {
JSClass nodeList_class = {
"nodeList",
JSCLASS_HAS_RESERVED_SLOTS(1),
JSCLASS_HAS_RESERVED_SLOTS(1) | JSCLASS_HAS_CACHED_PROTO(JSProto_Array),
&nodeList_ops
};

View File

@ -18,6 +18,14 @@ console.error('element.matches');
}
}
console.assert(ch, 'was matched');
birds = document.querySelectorAll('li');
ch = false;
var counter = 0;
birds.forEach(function(b) {
counter++;
});
console.assert(counter === 3, 'Three');
console.exit(0);