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 — repl: refactor ERR_SCRIPT_EXECUTION_INTERRUPTED stack handling · nodejs/node@e16dd6d

File tree

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

‎lib/repl.js‎

Copy file name to clipboardExpand all lines: lib/repl.js
+5-11Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -345,11 +345,6 @@ function REPLServer(prompt,
345345
} catch (e) {
346346
err = e;
347347

348-
if (err && err.code === 'ERR_SCRIPT_EXECUTION_INTERRUPTED') {
349-
// The stack trace for this case is not very useful anyway.
350-
Object.defineProperty(err, 'stack', { value: '' });
351-
}
352-
353348
if (process.domain) {
354349
debug('not recoverable, send to domain');
355350
process.domain.emit('error', err);
@@ -365,7 +360,11 @@ function REPLServer(prompt,
365360
if (self.breakEvalOnSigint) {
366361
const interrupt = new Promise((resolve, reject) => {
367362
sigintListener = () => {
368-
reject(new ERR_SCRIPT_EXECUTION_INTERRUPTED());
363+
const tmp = Error.stackTraceLimit;
364+
Error.stackTraceLimit = 0;
365+
const err = new ERR_SCRIPT_EXECUTION_INTERRUPTED();
366+
Error.stackTraceLimit = tmp;
367+
reject(err);
369368
};
370369
prioritizedSigintQueue.add(sigintListener);
371370
});
@@ -384,11 +383,6 @@ function REPLServer(prompt,
384383
// Remove prioritized SIGINT listener if it was not called.
385384
prioritizedSigintQueue.delete(sigintListener);
386385

387-
if (err.code === 'ERR_SCRIPT_EXECUTION_INTERRUPTED') {
388-
// The stack trace for this case is not very useful anyway.
389-
Object.defineProperty(err, 'stack', { value: '' });
390-
}
391-
392386
unpause();
393387
if (err && process.domain) {
394388
debug('not recoverable, send to domain');

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.