set.prototype.intersection
Advanced tools
Comparing version 1.0.2 to 1.1.0
@@ -5,9 +5,10 @@ 'use strict'; | ||
var $RangeError = GetIntrinsic('%RangeError%'); | ||
var $TypeError = GetIntrinsic('%TypeError%'); | ||
var Get = require('es-abstract/2022/Get'); | ||
var IsCallable = require('es-abstract/2022/IsCallable'); | ||
var ToIntegerOrInfinity = require('es-abstract/2022/ToIntegerOrInfinity'); | ||
var ToNumber = require('es-abstract/2022/ToNumber'); | ||
var Type = require('es-abstract/2022/Type'); | ||
var Get = require('es-abstract/2023/Get'); | ||
var IsCallable = require('es-abstract/2023/IsCallable'); | ||
var ToIntegerOrInfinity = require('es-abstract/2023/ToIntegerOrInfinity'); | ||
var ToNumber = require('es-abstract/2023/ToNumber'); | ||
var Type = require('es-abstract/2023/Type'); | ||
@@ -36,11 +37,15 @@ var isNaN = require('es-abstract/helpers/isNaN'); | ||
var has = Get(obj, 'has'); // step 7 | ||
if (intSize < 0) { | ||
throw new $RangeError('set size must be non-negative'); // step 7 | ||
} | ||
var has = Get(obj, 'has'); // step 8 | ||
if (!IsCallable(has)) { | ||
throw new $TypeError('has is not a function'); // step 8 | ||
throw new $TypeError('has is not a function'); // step 9 | ||
} | ||
var keys = Get(obj, 'keys'); // step 9 | ||
var keys = Get(obj, 'keys'); // step 10 | ||
if (!IsCallable(keys)) { | ||
throw new $TypeError('keys is not a function'); // step 10 | ||
throw new $TypeError('keys is not a function'); // step 11 | ||
} | ||
@@ -55,3 +60,3 @@ /* globals StopIteration: false */ | ||
return { '[[Set]]': obj, '[[Size]]': intSize, '[[Has]]': has, '[[Keys]]': keys }; // step 11 | ||
return { '[[Set]]': obj, '[[Size]]': intSize, '[[Has]]': has, '[[Keys]]': keys }; // step 12 | ||
}; |
@@ -7,4 +7,4 @@ 'use strict'; | ||
var IsArray = require('es-abstract/2022/IsArray'); | ||
var SameValueZero = require('es-abstract/2022/SameValueZero'); | ||
var IsArray = require('es-abstract/2023/IsArray'); | ||
var SameValueZero = require('es-abstract/2023/SameValueZero'); | ||
@@ -11,0 +11,0 @@ var some = require('es-abstract/helpers/some'); |
@@ -8,2 +8,14 @@ # Changelog | ||
## [v1.1.0](https://github.com/es-shims/Set.prototype.intersection/compare/v1.0.2...v1.1.0) - 2023-07-18 | ||
### Commits | ||
- [patch] remove GetKeysIterator and its callable check [`9f1b932`](https://github.com/es-shims/Set.prototype.intersection/commit/9f1b9325d37f922af37490e018e620a2b5dd1ac9) | ||
- [Deps] update `es-abstract`, `get-intrinsic` [`b73c04e`](https://github.com/es-shims/Set.prototype.intersection/commit/b73c04ed265fa1c25539b98cf3be6c4a0cb382c4) | ||
- [Tests] remove unused shimmed tests [`1114fb6`](https://github.com/es-shims/Set.prototype.intersection/commit/1114fb66fe826291efe11b7329273f90ef101361) | ||
- [patch] throw on negative set sizes [`b4e7b5f`](https://github.com/es-shims/Set.prototype.intersection/commit/b4e7b5f5304e4b61588fdb8faa0d60bf1dfd8e06) | ||
- [Dev Deps] update `@es-shims/api`, `@ljharb/eslint-config`, `aud`, `es6-shim`, `tape` [`681bb9f`](https://github.com/es-shims/Set.prototype.intersection/commit/681bb9fc33547046bbaf06f60482718be6b7a685) | ||
- [Deps] update `define-properties`, `es-abstract`, `get-intrinsic` [`8361911`](https://github.com/es-shims/Set.prototype.intersection/commit/83619113246b312108e2c1bec52474823b54a767) | ||
- [Dev Deps] update `@es-shims/api`, `tape` [`b25ffae`](https://github.com/es-shims/Set.prototype.intersection/commit/b25ffaec177f277b280a21a71884705624881d29) | ||
## [v1.0.2](https://github.com/es-shims/Set.prototype.intersection/compare/v1.0.1...v1.0.2) - 2023-01-14 | ||
@@ -10,0 +22,0 @@ |
@@ -11,12 +11,12 @@ 'use strict'; | ||
var Call = require('es-abstract/2022/Call'); | ||
var IteratorStep = require('es-abstract/2022/IteratorStep'); | ||
var IteratorValue = require('es-abstract/2022/IteratorValue'); | ||
var ToBoolean = require('es-abstract/2022/ToBoolean'); | ||
// var forEach = require('es-abstract/helpers/forEach'); | ||
var Call = require('es-abstract/2023/Call'); | ||
var GetIteratorFromMethod = require('es-abstract/2023/GetIteratorFromMethod'); | ||
var GetSetRecord = require('./aos/GetSetRecord'); | ||
var GetKeysIterator = require('./aos/GetKeysIterator'); | ||
var IteratorStep = require('es-abstract/2023/IteratorStep'); | ||
var IteratorValue = require('es-abstract/2023/IteratorValue'); | ||
// var SetDataHas = require('./aos/SetDataHas'); | ||
var ToBoolean = require('es-abstract/2023/ToBoolean'); | ||
// var forEach = require('es-abstract/helpers/forEach'); | ||
var isSet = require('is-set'); | ||
@@ -68,6 +68,6 @@ | ||
if (thisSize > otherRec['[[Size]]']) { | ||
var keysIter = GetKeysIterator(otherRec); // step 7.a | ||
var keysIter = GetIteratorFromMethod(otherRec['[[Set]]'], otherRec['[[Keys]]']); // step 7.a | ||
var next = true; // step 7.b | ||
while (next) { // step 7.c | ||
next = IteratorStep(keysIter['[[Iterator]]']); // step 7.c.i | ||
next = IteratorStep(keysIter); // step 7.c.i | ||
if (next) { // step 7.c.ii | ||
@@ -74,0 +74,0 @@ // var nextValue = IteratorValue(next); // step 7.c.ii.1 |
{ | ||
"name": "set.prototype.intersection", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"description": "An ESnext spec-compliant `Set.prototype.intersection` shim/polyfill/replacement that works as far down as ES3", | ||
@@ -27,3 +27,2 @@ "main": "index.js", | ||
"tests-only": "nyc tape 'test/**/*.js'", | ||
"test:shimmed": "nyc node test/builtin-shimmed", | ||
"test:native": "nyc node test/native", | ||
@@ -65,6 +64,6 @@ "prelint": "evalmd README.md", | ||
"call-bind": "^1.0.2", | ||
"define-properties": "^1.1.4", | ||
"es-abstract": "^1.21.1", | ||
"define-properties": "^1.2.0", | ||
"es-abstract": "^1.22.1", | ||
"es-set": "^1.1.0", | ||
"get-intrinsic": "^1.1.3", | ||
"get-intrinsic": "^1.2.1", | ||
"is-set": "^2.0.2", | ||
@@ -74,8 +73,8 @@ "stop-iteration-iterator": "^1.0.0" | ||
"devDependencies": { | ||
"@es-shims/api": "^2.2.3", | ||
"@ljharb/eslint-config": "^21.0.1", | ||
"aud": "^2.0.2", | ||
"@es-shims/api": "^2.4.2", | ||
"@ljharb/eslint-config": "^21.1.0", | ||
"aud": "^2.0.3", | ||
"auto-changelog": "^2.4.0", | ||
"es-value-fixtures": "^1.4.2", | ||
"es6-shim": "^0.35.7", | ||
"es6-shim": "^0.35.8", | ||
"eslint": "=8.8.0", | ||
@@ -91,3 +90,3 @@ "evalmd": "^0.0.19", | ||
"safe-publish-latest": "^2.0.0", | ||
"tape": "^5.6.1" | ||
"tape": "^5.6.5" | ||
}, | ||
@@ -94,0 +93,0 @@ "testling": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27806
22
484
Updateddefine-properties@^1.2.0
Updatedes-abstract@^1.22.1
Updatedget-intrinsic@^1.2.1