From e6c71acb183203d92661850f56d183292e851140 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 3 May 2021 20:29:07 -0700 Subject: [PATCH 1/4] debugger: wrap lines longer than 80 chars Wrap lines more than 80 chararcters long in inspect_repl.js so we can disable specific rules. --- lib/internal/inspector/inspect_repl.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/internal/inspector/inspect_repl.js b/lib/internal/inspector/inspect_repl.js index ab75abddd408db..2f706be661b888 100644 --- a/lib/internal/inspector/inspect_repl.js +++ b/lib/internal/inspector/inspect_repl.js @@ -1072,7 +1072,8 @@ function createRepl(inspector) { .then(() => Debugger.setPauseOnExceptions({ state: 'none' })) .then(() => Debugger.setAsyncCallStackDepth({ maxDepth: 0 })) .then(() => Debugger.setBlackboxPatterns({ patterns: [] })) - .then(() => Debugger.setPauseOnExceptions({ state: pauseOnExceptionState })) + .then(() => + Debugger.setPauseOnExceptions({ state: pauseOnExceptionState })) .then(() => restoreBreakpoints()) .then(() => Runtime.runIfWaitingForDebugger()); } From 8dfb0e580a497a5791fcfecd574157aa089bf356 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 3 May 2021 20:45:03 -0700 Subject: [PATCH 2/4] debugger: avoid non-ASCII char in code file Avoid non-ASCII char in lib code as a single non-ASCII char forces all the chars to be stored inefficiently, bloating the binary size. This also brings the file closer to compatibility with our lint rules. --- lib/internal/inspector/inspect_repl.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/internal/inspector/inspect_repl.js b/lib/internal/inspector/inspect_repl.js index 2f706be661b888..0ed5e93f586295 100644 --- a/lib/internal/inspector/inspect_repl.js +++ b/lib/internal/inspector/inspect_repl.js @@ -375,7 +375,10 @@ function createRepl(inspector) { [util.inspect.custom](depth, { stylize }) { const { startTime, endTime } = this.data; - return stylize(`[Profile ${endTime - startTime}μs]`, 'special'); + return stylize( + `[Profile ${endTime - startTime}${String.fromCharCode(956)}s]`, + 'special' + ); } save(filename = 'node.cpuprofile') { From 15117241ed2fa630c081e4a5c72a3ed73a803b60 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 3 May 2021 20:46:14 -0700 Subject: [PATCH 3/4] debugger: disable only the lint rules required by current file state --- lib/internal/inspector/inspect_repl.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/internal/inspector/inspect_repl.js b/lib/internal/inspector/inspect_repl.js index 0ed5e93f586295..3ed180f7619ecb 100644 --- a/lib/internal/inspector/inspect_repl.js +++ b/lib/internal/inspector/inspect_repl.js @@ -21,7 +21,8 @@ */ // TODO(trott): enable ESLint -/* eslint-disable */ +/* eslint-disable getter-return, no-restricted-syntax, + node-core/prefer-primordials */ 'use strict'; const FS = require('fs'); From 47ee7d88dbcbef359057de24a3f53cba4277c221 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 5 May 2021 21:36:15 -0700 Subject: [PATCH 4/4] fixup! debugger: disable only the lint rules required by current file state --- lib/internal/inspector/inspect_repl.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/internal/inspector/inspect_repl.js b/lib/internal/inspector/inspect_repl.js index 3ed180f7619ecb..1dced0776fe478 100644 --- a/lib/internal/inspector/inspect_repl.js +++ b/lib/internal/inspector/inspect_repl.js @@ -376,10 +376,8 @@ function createRepl(inspector) { [util.inspect.custom](depth, { stylize }) { const { startTime, endTime } = this.data; - return stylize( - `[Profile ${endTime - startTime}${String.fromCharCode(956)}s]`, - 'special' - ); + const MU = String.fromChar(956); + return stylize(`[Profile ${endTime - startTime}${MU}s]`, 'special'); } save(filename = 'node.cpuprofile') {