Skip to content

Commit

Permalink
[Refactor] use es-errors instead of get-intrinsic where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Feb 4, 2024
1 parent 37da5f2 commit 05a25ae
Show file tree
Hide file tree
Showing 23 changed files with 25 additions and 66 deletions.
4 changes: 1 addition & 3 deletions Iterator.from/implementation.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
'use strict';

var GetIntrinsic = require('get-intrinsic');

var $TypeError = GetIntrinsic('%TypeError%');
var $TypeError = require('es-errors/type');

var GetIteratorFlattenable = require('../aos/GetIteratorFlattenable');
var OrdinaryHasInstance = require('es-abstract/2023/OrdinaryHasInstance');
Expand Down
6 changes: 2 additions & 4 deletions Iterator.prototype.drop/implementation.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
'use strict';

var GetIntrinsic = require('get-intrinsic');

var $RangeError = GetIntrinsic('%RangeError%');
var $TypeError = GetIntrinsic('%TypeError%');
var $RangeError = require('es-errors/range');
var $TypeError = require('es-errors/type');

var CompletionRecord = require('es-abstract/2023/CompletionRecord');
var CreateIteratorFromClosure = require('../aos/CreateIteratorFromClosure');
Expand Down
4 changes: 1 addition & 3 deletions Iterator.prototype.every/implementation.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
'use strict';

var GetIntrinsic = require('get-intrinsic');

var $TypeError = GetIntrinsic('%TypeError%');
var $TypeError = require('es-errors/type');

var Call = require('es-abstract/2023/Call');
var GetIteratorDirect = require('../aos/GetIteratorDirect');
Expand Down
4 changes: 1 addition & 3 deletions Iterator.prototype.filter/implementation.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
'use strict';

var GetIntrinsic = require('get-intrinsic');

var $TypeError = GetIntrinsic('%TypeError%');
var $TypeError = require('es-errors/type');

var Call = require('es-abstract/2023/Call');
var CompletionRecord = require('es-abstract/2023/CompletionRecord');
Expand Down
4 changes: 1 addition & 3 deletions Iterator.prototype.find/implementation.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
'use strict';

var GetIntrinsic = require('get-intrinsic');

var $TypeError = GetIntrinsic('%TypeError%');
var $TypeError = require('es-errors/type');

var Call = require('es-abstract/2023/Call');
var GetIteratorDirect = require('../aos/GetIteratorDirect');
Expand Down
4 changes: 1 addition & 3 deletions Iterator.prototype.flatMap/implementation.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
'use strict';

var GetIntrinsic = require('get-intrinsic');

var $TypeError = GetIntrinsic('%TypeError%');
var $TypeError = require('es-errors/type');

var Call = require('es-abstract/2023/Call');
var CompletionRecord = require('es-abstract/2023/CompletionRecord');
Expand Down
4 changes: 1 addition & 3 deletions Iterator.prototype.forEach/implementation.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
'use strict';

var GetIntrinsic = require('get-intrinsic');

var $TypeError = GetIntrinsic('%TypeError%');
var $TypeError = require('es-errors/type');

var Call = require('es-abstract/2023/Call');
var GetIteratorDirect = require('../aos/GetIteratorDirect');
Expand Down
4 changes: 1 addition & 3 deletions Iterator.prototype.map/implementation.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
'use strict';

var GetIntrinsic = require('get-intrinsic');

var $TypeError = GetIntrinsic('%TypeError%');
var $TypeError = require('es-errors/type');

var Call = require('es-abstract/2023/Call');
var CompletionRecord = require('es-abstract/2023/CompletionRecord');
Expand Down
4 changes: 1 addition & 3 deletions Iterator.prototype.reduce/implementation.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
'use strict';

var GetIntrinsic = require('get-intrinsic');

var $TypeError = GetIntrinsic('%TypeError%');
var $TypeError = require('es-errors/type');

var Call = require('es-abstract/2023/Call');
var GetIteratorDirect = require('../aos/GetIteratorDirect');
Expand Down
4 changes: 1 addition & 3 deletions Iterator.prototype.some/implementation.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
'use strict';

var GetIntrinsic = require('get-intrinsic');

var $TypeError = GetIntrinsic('%TypeError%');
var $TypeError = require('es-errors/type');

var Call = require('es-abstract/2023/Call');
var GetIteratorDirect = require('../aos/GetIteratorDirect');
Expand Down
6 changes: 2 additions & 4 deletions Iterator.prototype.take/implementation.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
'use strict';

var GetIntrinsic = require('get-intrinsic');

var $RangeError = GetIntrinsic('%RangeError%');
var $TypeError = GetIntrinsic('%TypeError%');
var $RangeError = require('es-errors/range');
var $TypeError = require('es-errors/type');

var CompletionRecord = require('es-abstract/2023/CompletionRecord');
var CreateIteratorFromClosure = require('../aos/CreateIteratorFromClosure');
Expand Down
4 changes: 1 addition & 3 deletions Iterator.prototype.toArray/implementation.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
'use strict';

var GetIntrinsic = require('get-intrinsic');

var $TypeError = GetIntrinsic('%TypeError%');
var $TypeError = require('es-errors/type');

var GetIteratorDirect = require('../aos/GetIteratorDirect');
var IteratorStepValue = require('../aos/IteratorStepValue');
Expand Down
2 changes: 1 addition & 1 deletion Iterator/implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
var GetIntrinsic = require('get-intrinsic');
var hasPropertyDescriptors = require('has-property-descriptors')();

var $TypeError = GetIntrinsic('%TypeError%');
var $TypeError = require('es-errors/type');
var $defineProperty = hasPropertyDescriptors && GetIntrinsic('%Object.defineProperty%', true);

var iterProto = require('iterator.prototype');
Expand Down
4 changes: 1 addition & 3 deletions WrapForValidIteratorPrototype/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
'use strict';

var GetIntrinsic = require('get-intrinsic');

var $TypeError = GetIntrinsic('%TypeError%');
var $TypeError = require('es-errors/type');

var Call = require('es-abstract/2023/Call');
var CreateIterResultObject = require('es-abstract/2023/CreateIterResultObject');
Expand Down
4 changes: 1 addition & 3 deletions aos/CreateIteratorFromClosure.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
'use strict';

var GetIntrinsic = require('get-intrinsic');

var $TypeError = GetIntrinsic('%TypeError%');
var $TypeError = require('es-errors/type');

var GeneratorStart = require('./GeneratorStart');
var IsArray = require('es-abstract/2023/IsArray');
Expand Down
4 changes: 1 addition & 3 deletions aos/GeneratorResume.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
'use strict';

var GetIntrinsic = require('get-intrinsic');

var $TypeError = GetIntrinsic('%TypeError%');
var $TypeError = require('es-errors/type');

var CreateIterResultObject = require('es-abstract/2023/CreateIterResultObject');
var GeneratorValidate = require('./GeneratorValidate');
Expand Down
4 changes: 1 addition & 3 deletions aos/GeneratorResumeAbrupt.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
'use strict';

var GetIntrinsic = require('get-intrinsic');

var $TypeError = GetIntrinsic('%TypeError%');
var $TypeError = require('es-errors/type');

var CompletionRecord = require('es-abstract/2023/CompletionRecord');
var CreateIterResultObject = require('es-abstract/2023/CreateIterResultObject');
Expand Down
4 changes: 1 addition & 3 deletions aos/GeneratorStart.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
'use strict';

var GetIntrinsic = require('get-intrinsic');

var $TypeError = GetIntrinsic('%TypeError%');
var $TypeError = require('es-errors/type');

var CreateIterResultObject = require('es-abstract/2023/CreateIterResultObject');
var IsCallable = require('es-abstract/2023/IsCallable');
Expand Down
4 changes: 1 addition & 3 deletions aos/GeneratorValidate.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
'use strict';

var GetIntrinsic = require('get-intrinsic');

var $TypeError = GetIntrinsic('%TypeError%');
var $TypeError = require('es-errors/type');

var SLOT = require('internal-slot');

Expand Down
4 changes: 1 addition & 3 deletions aos/GetIteratorDirect.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
'use strict';

var GetIntrinsic = require('get-intrinsic');

var $TypeError = GetIntrinsic('%TypeError%');
var $TypeError = require('es-errors/type');

var Get = require('es-abstract/2023/Get');
var Type = require('es-abstract/2023/Type');
Expand Down
4 changes: 1 addition & 3 deletions aos/GetIteratorFlattenable.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
'use strict';

var GetIntrinsic = require('get-intrinsic');

var $TypeError = GetIntrinsic('%TypeError%');
var $TypeError = require('es-errors/type');

var AdvanceStringIndex = require('es-abstract/2023/AdvanceStringIndex');
var Call = require('es-abstract/2023/Call');
Expand Down
4 changes: 1 addition & 3 deletions aos/IteratorClose.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
'use strict';

var GetIntrinsic = require('get-intrinsic');

var $TypeError = GetIntrinsic('%TypeError%');
var $TypeError = require('es-errors/type');

var Call = require('es-abstract/2023/Call');
var CompletionRecord = require('es-abstract/2023/CompletionRecord');
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
"call-bind": "^1.0.5",
"define-properties": "^1.2.1",
"es-abstract": "^1.22.3",
"es-errors": "^1.0.0",
"es-set-tostringtag": "^2.0.2",
"function-bind": "^1.1.2",
"get-intrinsic": "^1.2.3",
Expand Down

0 comments on commit 05a25ae

Please sign in to comment.