From ad6b20f25bb5e8623a4be25eb990e32a4224466e Mon Sep 17 00:00:00 2001 From: jdalton Date: Thu, 12 Dec 2024 15:07:03 -0500 Subject: [PATCH] debug --- packages/npm/json-stable-stringify/index.js | 44 ++++++++++----------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/packages/npm/json-stable-stringify/index.js b/packages/npm/json-stable-stringify/index.js index d4f37bf5..e2034708 100644 --- a/packages/npm/json-stable-stringify/index.js +++ b/packages/npm/json-stable-stringify/index.js @@ -2,7 +2,7 @@ const { isArray: ArrayIsArray } = Array const { isFinite: NumberIsFinite } = Number -const { freeze: ObjectFreeze, keys: ObjectKeys } = Object +const { /*freeze: ObjectFreeze,*/ keys: ObjectKeys } = Object const { isRawJSON, stringify } = JSON const SUPPORTS_ARRAY_PROTO_TO_SORTED = @@ -20,26 +20,26 @@ const TYPE_VALUE = 1 const TYPE_OPEN = 2 const TYPE_CLOSE = 4 -let callStackSizeExceededErrorDetails +//let callStackSizeExceededErrorDetails -function getCallStackSizeExceededErrorDetails() { - if (callStackSizeExceededErrorDetails === undefined) { - let limit = 0 - try { - ;(function r() { - limit += 1 - r() - })() - } catch ({ constructor, message }) { - callStackSizeExceededErrorDetails = ObjectFreeze({ - Ctor: constructor, - limit, - message - }) - } - } - return callStackSizeExceededErrorDetails -} +// function getCallStackSizeExceededErrorDetails() { +// if (callStackSizeExceededErrorDetails === undefined) { +// let limit = 0 +// try { +// ;(function r() { +// limit += 1 +// r() +// })() +// } catch ({ constructor, message }) { +// callStackSizeExceededErrorDetails = ObjectFreeze({ +// Ctor: constructor, +// limit, +// message +// }) +// } +// } +// return callStackSizeExceededErrorDetails +// } function stableStringifyNonRecursive(obj, cmp, cycles, replacer, space) { let result = '' @@ -246,8 +246,8 @@ module.exports = function stableStringify(obj, opts = {}) { return stableStringifyRecursive(obj, cmp, cycles, replacer, space) } catch (e) { if (e) { - const { Ctor, message } = getCallStackSizeExceededErrorDetails() - if (e instanceof Ctor && e.message === message) { + // const { Ctor, message } = getCallStackSizeExceededErrorDetails() + if (e) { callStackLimitTripped = true return stableStringifyNonRecursive(obj, cmp, cycles, replacer, space) }