We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aafd152 commit 0e8e266Copy full SHA for 0e8e266
lib/internal/repl/history.js
@@ -396,6 +396,7 @@ class ReplHistory {
396
}
397
398
399
+ // === FIXED VERSION FOR ISSUE #60837 ===
400
[kReplHistoryMessage]() {
401
if (this[kHistory].length === 0) {
402
ReplHistory[kWriteToOutput](
@@ -405,8 +406,16 @@ class ReplHistory {
405
406
'a valid, user-writable path to enable.\n',
407
);
408
- this[kContext]._historyPrev = this.historyPrev;
409
- return this[kContext]._historyPrev();
+
410
+ const prev = this.historyPrev;
411
+ this[kContext]._historyPrev = prev;
412
413
+ // Fix: Propagate callback errors
414
+ try {
415
+ return prev.call(this[kContext]);
416
+ } catch (err) {
417
+ process.nextTick(() => { throw err; });
418
+ }
419
420
421
0 commit comments