Skip to content
Permalink
Browse files

lib: replace use of Error with primordials

PR-URL: #31163
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
  • Loading branch information
Sebastien-Ahkrin authored and targos committed Jan 2, 2020
1 parent 3f21ad6 commit f268621ffaed0548395a2546765d5a4129c3bafc
@@ -15,6 +15,8 @@ rules:
message: "Use `const { BigInt } = primordials;` instead of the global."
- name: Boolean
message: "Use `const { Boolean } = primordials;` instead of the global."
- name: Error
message: "Use `const { Error } = primordials;` instead of the global."
- name: JSON
message: "Use `const { JSON } = primordials;` instead of the global."
- name: Math
@@ -24,6 +24,7 @@
const {
ArrayIsArray,
Boolean,
Error,
NumberIsFinite,
ObjectAssign,
ObjectKeys,
@@ -22,6 +22,7 @@
'use strict';

const {
Error,
ObjectKeys,
ObjectSetPrototypeOf,
Symbol,
@@ -21,6 +21,7 @@
'use strict';

const {
Error,
ObjectAssign,
ObjectIs,
ObjectKeys,
@@ -24,6 +24,7 @@
const {
Array,
ArrayIsArray,
Error,
MathFloor,
MathMin,
MathTrunc,
@@ -23,6 +23,7 @@

const {
ArrayIsArray,
Error,
NumberIsInteger,
ObjectAssign,
ObjectDefineProperty,
@@ -28,6 +28,7 @@

const {
Array,
Error,
ObjectDefineProperty,
ReflectApply,
Symbol,
@@ -24,6 +24,7 @@
const {
Array,
Boolean,
Error,
MathMin,
NumberIsNaN,
ObjectCreate,
@@ -1,6 +1,7 @@
'use strict';

const {
Error,
MathMax,
ObjectCreate,
ObjectDefineProperty,
@@ -1,6 +1,7 @@
'use strict';

const {
Error,
FunctionPrototypeBind,
NumberIsSafeInteger,
ObjectDefineProperty,
@@ -44,6 +44,7 @@
/* global process, getLinkedBinding, getInternalBinding, primordials */

const {
Error,
ReflectGet,
ObjectCreate,
ObjectDefineProperty,
@@ -7,6 +7,7 @@ const {
ArrayFrom,
ArrayIsArray,
Boolean,
Error,
MathFloor,
Number,
ObjectDefineProperties,
@@ -3,6 +3,7 @@
const Buffer = require('buffer').Buffer;
const {
ArrayPrototypeForEach,
Error,
FunctionPrototypeCall,
ObjectAssign,
ObjectCreate,
@@ -12,6 +12,7 @@

const {
ArrayIsArray,
Error,
MathAbs,
NumberIsInteger,
ObjectDefineProperty,
@@ -4,6 +4,7 @@ const {
ArrayIsArray,
BigInt,
DateNow,
Error,
Number,
NumberIsFinite,
ObjectSetPrototypeOf,
@@ -2,6 +2,7 @@

const {
ArrayIsArray,
Error,
MathMax,
Number,
ObjectCreate,
@@ -23,6 +23,7 @@

const {
ArrayIsArray,
Error,
JSONParse,
ObjectCreate,
ObjectDefineProperty,
@@ -1,6 +1,7 @@
'use strict';

const {
Error,
ObjectDefineProperties,
ObjectDefineProperty,
SafeWeakMap,
@@ -1,6 +1,7 @@
'use strict';

const {
Error,
ObjectDefineProperty,
WeakMap,
} = primordials;
@@ -2,6 +2,7 @@

const {
ArrayIsArray,
Error,
} = primordials;

const { ERR_INVALID_ARG_TYPE } = require('internal/errors').codes;
@@ -1,5 +1,9 @@
'use strict';

const {
Error,
} = primordials;

const debug = require('internal/util/debuglog').debuglog('source_map');
const { findSourceMap } = require('internal/source_map/source_map_cache');
const {
@@ -3,6 +3,7 @@
const {
ArrayFrom,
ArrayIsArray,
Error,
ObjectCreate,
ObjectDefineProperties,
ObjectDefineProperty,
@@ -5,6 +5,7 @@ const {
BigIntPrototypeValueOf,
BooleanPrototypeValueOf,
DatePrototypeGetTime,
Error,
NumberIsNaN,
NumberPrototypeValueOf,
ObjectGetOwnPropertySymbols,
@@ -25,6 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

/* eslint-disable no-restricted-globals */

module.exports = { versionCheck };

// Don't execute when required directly instead of being eval'd from
@@ -24,6 +24,7 @@
const {
ArrayIsArray,
Boolean,
Error,
Number,
NumberIsNaN,
ObjectDefineProperty,
@@ -43,6 +43,7 @@
'use strict';

const {
Error,
MathMax,
NumberIsNaN,
ObjectAssign,
@@ -23,6 +23,7 @@

const {
ArrayIsArray,
Error,
NumberIsSafeInteger,
ObjectDefineProperties,
ObjectDefineProperty,
@@ -17,6 +17,7 @@
const {
Array,
ArrayBuffer,
Error,
Float32Array,
Float64Array,
Int16Array,
@@ -22,6 +22,7 @@
'use strict';

const {
Error,
MathMax,
NumberIsFinite,
NumberIsNaN,

0 comments on commit f268621

Please sign in to comment.
You can’t perform that action at this time.