GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — util: fix indentationLvl when exceeding max call stack size · nodejs/node@077e7e0

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • util.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/util.js‎

Copy file name to clipboardExpand all lines: lib/util.js
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,7 @@ function formatRaw(ctx, value, recurseTimes) {
832832

833833
ctx.seen.push(value);
834834
let output;
835+
const indentationLvl = ctx.indentationLvl;
835836
try {
836837
output = formatter(ctx, value, recurseTimes, keys);
837838
if (skip === false) {
@@ -841,16 +842,17 @@ function formatRaw(ctx, value, recurseTimes) {
841842
}
842843
}
843844
} catch (err) {
844-
return handleMaxCallStackSize(ctx, err, constructor, tag);
845+
return handleMaxCallStackSize(ctx, err, constructor, tag, indentationLvl);
845846
}
846847
ctx.seen.pop();
847848

848849
return reduceToSingleString(ctx, output, base, braces);
849850
}
850851

851-
function handleMaxCallStackSize(ctx, err, constructor, tag) {
852+
function handleMaxCallStackSize(ctx, err, constructor, tag, indentationLvl) {
852853
if (errors.isStackOverflowError(err)) {
853854
ctx.seen.pop();
855+
ctx.indentationLvl = indentationLvl;
854856
return ctx.stylize(
855857
`[${constructor || tag || 'Object'}: Inspection interrupted ` +
856858
'prematurely. Maximum call stack size exceeded.]',

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.