summaryrefslogtreecommitdiff
path: root/lib/util.js
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2018-05-07 03:53:02 +0200
committerRuben Bridgewater <ruben@bridgewater.de>2018-05-18 15:27:29 +0200
commit17d95ea1f0be2204cc040b8b0a9d1144f28baaab (patch)
treec9ca7f0d797bd2501adfd82d4bca23e455b91cce /lib/util.js
parente0c71ca3eb645457a7e6e369bf8ad4c1a62902c2 (diff)
downloadandroid-node-v8-17d95ea1f0be2204cc040b8b0a9d1144f28baaab.tar.gz
android-node-v8-17d95ea1f0be2204cc040b8b0a9d1144f28baaab.tar.bz2
android-node-v8-17d95ea1f0be2204cc040b8b0a9d1144f28baaab.zip
assert,util: lazy load comparison functions
PR-URL: https://github.com/nodejs/node/pull/20567 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Diffstat (limited to 'lib/util.js')
-rw-r--r--lib/util.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/util.js b/lib/util.js
index 45d98de194..bd7a98694b 100644
--- a/lib/util.js
+++ b/lib/util.js
@@ -65,10 +65,6 @@ const {
} = types;
const {
- isDeepStrictEqual
-} = require('internal/util/comparisons');
-
-const {
customInspectSymbol,
deprecate,
getSystemErrorName: internalErrorName,
@@ -95,6 +91,7 @@ const dateToISOString = Date.prototype.toISOString;
const errorToString = Error.prototype.toString;
let CIRCULAR_ERROR_MESSAGE;
+let internalDeepEqual;
/* eslint-disable */
const strEscapeSequencesRegExp = /[\x00-\x1f\x27\x5c]/;
@@ -1261,7 +1258,13 @@ module.exports = exports = {
isArray: Array.isArray,
isBoolean,
isBuffer,
- isDeepStrictEqual,
+ isDeepStrictEqual(a, b) {
+ if (internalDeepEqual === undefined) {
+ internalDeepEqual = require('internal/util/comparisons')
+ .isDeepStrictEqual;
+ }
+ return internalDeepEqual(a, b);
+ },
isNull,
isNullOrUndefined,
isNumber,