Skip to content

Commit

Permalink
[Refactor] use call-bound directly
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Dec 20, 2024
1 parent e9eefab commit 92afc5a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
6 changes: 1 addition & 5 deletions Iterator.prototype.toArray/implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ var GetIteratorDirect = require('../aos/GetIteratorDirect');
var IteratorStepValue = require('es-abstract/2024/IteratorStepValue');
var Type = require('es-abstract/2024/Type');

var callBound = require('call-bind/callBound');

var $push = callBound('Array.prototype.push');

module.exports = function toArray() {
if (this instanceof toArray) {
throw new $TypeError('`toArray` is not a constructor');
Expand All @@ -31,6 +27,6 @@ module.exports = function toArray() {
if (iterated['[[Done]]']) {
return items; // step 5.b
}
$push(items, value); // step 5.d
items[items.length] = value; // step 5.d
}
};
2 changes: 1 addition & 1 deletion Iterator/implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var $TypeError = require('es-errors/type');
var $defineProperty = hasPropertyDescriptors && GetIntrinsic('%Object.defineProperty%', true);

var iterProto = require('iterator.prototype');
var callBound = require('call-bind/callBound');
var callBound = require('call-bound');

var $isPrototypeOf = callBound('Object.prototype.isPrototypeOf');

Expand Down
2 changes: 1 addition & 1 deletion aos/IteratorZip.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var IsArray = require('es-abstract/helpers/IsArray');
var isIteratorRecord = require('es-abstract/helpers/records/iterator-record');
var every = require('es-abstract/helpers/every');

var callBound = require('call-bind/callBound');
var callBound = require('call-bound');

var $indexOf = callBound('Array.prototype.indexOf');
var $slice = callBound('Array.prototype.slice');
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
"homepage": "https://github.com/es-shims/iterator-helpers#readme",
"dependencies": {
"call-bind": "^1.0.8",
"call-bound": "^1.0.3",
"define-properties": "^1.2.1",
"es-abstract": "^1.23.6",
"es-errors": "^1.3.0",
Expand Down

0 comments on commit 92afc5a

Please sign in to comment.