diff --git a/package.json b/package.json index 5fc5801..2d2005f 100644 --- a/package.json +++ b/package.json @@ -72,6 +72,7 @@ "@ljharb/eslint-config": "^21.1.0", "aud": "^2.0.4", "auto-changelog": "^2.4.0", + "es-get-iterator": "^1.1.3", "es-map": "^1.0.5", "es-value-fixtures": "^1.4.2", "es6-shim": "^0.35.8", diff --git a/test/tests.js b/test/tests.js index 6ab5f31..5cbb908 100644 --- a/test/tests.js +++ b/test/tests.js @@ -5,6 +5,7 @@ var forEach = require('for-each'); var v = require('es-value-fixtures'); var debug = require('object-inspect'); var $Map = require('es-map/polyfill')(); +var getIterator = require('es-get-iterator'); var setEqual = function compareSetLikes(t, actual, expected, msg) { t.test('setlikes: ' + msg, function (st) { @@ -344,7 +345,6 @@ module.exports = function (intersection, t) { var setlikeWithMinusZero = { size: 1, has: function () { - // impossible to avoid this call since we do not have internal set data access throw new EvalError('Set.prototype.intersection should not invoke .has on its argument when this.size > arg.size'); }, keys: function () { @@ -381,7 +381,7 @@ module.exports = function (intersection, t) { size: 2, has: undefined, keys: function () { - return [2, 3]; + return getIterator([2, 3]); } }; st['throws']( @@ -486,7 +486,7 @@ module.exports = function (intersection, t) { size: undefined, has: function () {}, keys: function () { - return [2, 3]; + return getIterator([2, 3]); } }; st['throws'](