1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:57:35 +00:00

LibJS: Integrate iterator protocol into language features

Finally use Symbol.iterator protocol in language features :) currently
only used in for-of loops and spread expressions, but will have more
uses later (Maps, Sets, Array.from, etc).
This commit is contained in:
Matthew Olsson 2020-07-13 08:27:20 -07:00 committed by Andreas Kling
parent 4970c448bf
commit a51b2393f2
8 changed files with 187 additions and 127 deletions

View file

@ -200,7 +200,6 @@ class ExpectationError extends Error {
toContain(item) {
this.__doMatcher(() => {
// FIXME: Iterator check
for (let element of this.target) {
if (item === element) return;
}
@ -211,7 +210,6 @@ class ExpectationError extends Error {
toContainEqual(item) {
this.__doMatcher(() => {
// FIXME: Iterator check
for (let element of this.target) {
if (deepEquals(item, element)) return;
}