mirror of
https://github.com/rkd77/elinks.git
synced 2024-09-27 02:56:18 -04:00
[spidermonkey] forEach and other Array methods for nodelist
This commit is contained in:
parent
15ac18c04f
commit
8bba9f8c4e
@ -82,7 +82,7 @@ JSClassOps nodeList_ops = {
|
|||||||
|
|
||||||
JSClass nodeList_class = {
|
JSClass nodeList_class = {
|
||||||
"nodeList",
|
"nodeList",
|
||||||
JSCLASS_HAS_RESERVED_SLOTS(1),
|
JSCLASS_HAS_RESERVED_SLOTS(1) | JSCLASS_HAS_CACHED_PROTO(JSProto_Array),
|
||||||
&nodeList_ops
|
&nodeList_ops
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -18,6 +18,14 @@ console.error('element.matches');
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.assert(ch, 'was matched');
|
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);
|
console.exit(0);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user