Skip to content

Commit

Permalink
add a workaround for testing DOM collections iterators with non-stand…
Browse files Browse the repository at this point in the history
…ard behaviour of DOM collections prototypes in Safari ~12
  • Loading branch information
zloirock committed Feb 18, 2021
1 parent 8a71f7a commit 1ae4619
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/pure/web.dom-collections.iterator.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ QUnit.test('Iterable DOM collections', assert => {
for (const name of collections) {
const Collection = GLOBAL[name];
if (Collection) {
assert.same(Collection.prototype[Symbol.toStringTag], name, `${ name }::@@toStringTag is '${ name }'`);
assert.isFunction(getIteratorMethod(Collection.prototype), `${ name }::@@iterator is function`);
absent = false;
assert.same(Collection.prototype[Symbol.toStringTag], name, `${ name }::@@toStringTag is '${ name }'`);
if (Object.prototype.toString.call(Collection.prototype).slice(8, -1) === name) {
assert.isFunction(getIteratorMethod(Collection.prototype), `${ name }::@@iterator is function`);
}
}
}

Expand Down

0 comments on commit 1ae4619

Please sign in to comment.