Skip to content

Commit 9c1d309

Browse files
lib: enhance use of Error from primordials
1 parent e9695d9 commit 9c1d309

29 files changed

Lines changed: 34 additions & 0 deletions

lib/.eslintrc.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ rules:
2929
message: "Use `const { Reflect } = primordials;` instead of the global."
3030
- name: Symbol
3131
message: "Use `const { Symbol } = primordials;` instead of the global."
32+
- name: Error
33+
message: "Use `const { Error } = primordials;` instead of the global."
3234
no-restricted-syntax:
3335
# Config copied from .eslintrc.js
3436
- error

lib/_http_client.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
const {
2525
ArrayIsArray,
2626
Boolean,
27+
Error,
2728
NumberIsFinite,
2829
ObjectAssign,
2930
ObjectKeys,

lib/_http_server.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
'use strict';
2323

2424
const {
25+
Error,
2526
ObjectKeys,
2627
ObjectSetPrototypeOf,
2728
Symbol,

lib/assert.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
'use strict';
2222

2323
const {
24+
Error,
2425
ObjectAssign,
2526
ObjectIs,
2627
ObjectKeys,

lib/buffer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
const {
2525
Array,
2626
ArrayIsArray,
27+
Error,
2728
MathFloor,
2829
MathMin,
2930
MathTrunc,

lib/child_process.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
const {
2525
ArrayIsArray,
26+
Error,
2627
NumberIsInteger,
2728
ObjectAssign,
2829
ObjectDefineProperty,

lib/domain.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
const {
3030
Array,
31+
Error,
3132
ObjectDefineProperty,
3233
ReflectApply,
3334
Symbol,

lib/events.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
const {
2525
Array,
2626
Boolean,
27+
Error,
2728
MathMin,
2829
NumberIsNaN,
2930
ObjectCreate,

lib/internal/assert/assertion_error.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict';
22

33
const {
4+
Error,
45
MathMax,
56
ObjectCreate,
67
ObjectDefineProperty,

lib/internal/async_hooks.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict';
22

33
const {
4+
Error,
45
FunctionPrototypeBind,
56
NumberIsSafeInteger,
67
ObjectDefineProperty,

0 commit comments

Comments
 (0)