Skip to content

Commit

Permalink
[Refactor] use es-errors where possible, so things that only need t…
Browse files Browse the repository at this point in the history
…hose do not need `get-intrinsic`
  • Loading branch information
ljharb committed Feb 5, 2024
1 parent 2353b34 commit 594cdae
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 15 deletions.
3 changes: 1 addition & 2 deletions Error/implementation.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
'use strict';

var GetIntrinsic = require('get-intrinsic');
var hasPropertyDescriptors = require('has-property-descriptors')();
var CreateMethodProperty = require('es-abstract/2023/CreateMethodProperty');
var InstallErrorCause = require('es-abstract/2023/InstallErrorCause');
var setProto = require('es-abstract/helpers/setProto');

var $Error = GetIntrinsic('%Error%');
var $Error = require('es-errors');

function Error(message) {
var O = arguments.length > 1 ? new $Error(message, arguments[1]) : new $Error(message);
Expand Down
3 changes: 1 addition & 2 deletions EvalError/implementation.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
'use strict';

var GetIntrinsic = require('get-intrinsic');
var hasPropertyDescriptors = require('has-property-descriptors')();

var $EvalError = GetIntrinsic('%EvalError%');
var $EvalError = require('es-errors/eval');

var CreateMethodProperty = require('es-abstract/2023/CreateMethodProperty');
var InstallErrorCause = require('es-abstract/2023/InstallErrorCause');
Expand Down
3 changes: 1 addition & 2 deletions RangeError/implementation.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
'use strict';

var GetIntrinsic = require('get-intrinsic');
var hasPropertyDescriptors = require('has-property-descriptors')();

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

var CreateMethodProperty = require('es-abstract/2023/CreateMethodProperty');
var InstallErrorCause = require('es-abstract/2023/InstallErrorCause');
Expand Down
3 changes: 1 addition & 2 deletions ReferenceError/implementation.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
'use strict';

var GetIntrinsic = require('get-intrinsic');
var hasPropertyDescriptors = require('has-property-descriptors')();

var $ReferenceError = GetIntrinsic('%ReferenceError%');
var $ReferenceError = require('es-errors/ref');

var CreateMethodProperty = require('es-abstract/2023/CreateMethodProperty');
var InstallErrorCause = require('es-abstract/2023/InstallErrorCause');
Expand Down
3 changes: 1 addition & 2 deletions SyntaxError/implementation.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
'use strict';

var GetIntrinsic = require('get-intrinsic');
var hasPropertyDescriptors = require('has-property-descriptors')();

var $SyntaxError = GetIntrinsic('%SyntaxError%');
var $SyntaxError = require('es-errors/syntax');

var CreateMethodProperty = require('es-abstract/2023/CreateMethodProperty');
var InstallErrorCause = require('es-abstract/2023/InstallErrorCause');
Expand Down
3 changes: 1 addition & 2 deletions TypeError/implementation.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
'use strict';

var GetIntrinsic = require('get-intrinsic');
var hasPropertyDescriptors = require('has-property-descriptors')();

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

var CreateMethodProperty = require('es-abstract/2023/CreateMethodProperty');
var InstallErrorCause = require('es-abstract/2023/InstallErrorCause');
Expand Down
3 changes: 1 addition & 2 deletions URIError/implementation.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
'use strict';

var GetIntrinsic = require('get-intrinsic');
var hasPropertyDescriptors = require('has-property-descriptors')();

var $URIError = GetIntrinsic('%URIError%');
var $URIError = require('es-errors/uri');

var CreateMethodProperty = require('es-abstract/2023/CreateMethodProperty');
var InstallErrorCause = require('es-abstract/2023/InstallErrorCause');
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"define-properties": "^1.2.1",
"es-abstract": "^1.22.3",
"es-aggregate-error": "^1.0.12",
"get-intrinsic": "^1.2.3",
"es-errors": "^1.3.0",
"globalthis": "^1.0.3",
"has-property-descriptors": "^1.0.1"
},
Expand Down

0 comments on commit 594cdae

Please sign in to comment.