repl: fix disruptive autocomplete without inspector · nodejs/node@04de576 · GitHub
Skip to content

Commit 04de576

Browse files
Linkgorontargos
authored andcommitted
repl: fix disruptive autocomplete without inspector
Fix an issue where the autocomplete wrongly autocompletes a value from a correct value to an undefined value when `node` is built without an inspector by disabling the preview view. fixes: #40635 PR-URL: #40661 Fixes: #40635 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent ace65a9 commit 04de576

3 files changed

Lines changed: 164 additions & 3 deletions

File tree

lib/internal/repl/utils.js

Lines changed: 1 addition & 1 deletion

test/parallel/test-repl-history-navigation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ const tests = [
585585
prompt, ...'const util = {}',
586586
'undefined\n',
587587
prompt, ...'ut', ...(prev ? [' // il', '\n// {}',
588-
'il', '\n// {}'] : [' // il', 'il']),
588+
'il', '\n// {}'] : ['il']),
589589
'{}\n',
590590
prompt,
591591
],
@@ -605,7 +605,7 @@ const tests = [
605605
'undefined\n',
606606
prompt, ...'globalThis.util = {}',
607607
'{}\n',
608-
prompt, ...'ut', ' // il', 'il',
608+
prompt, ...'ut', ...(prev ? [' // il', 'il' ] : ['il']),
609609
'{}\n',
610610
prompt, ...'Reflect.defineProperty(globalThis, "util", utilDesc)',
611611
'true\n',
Lines changed: 161 additions & 0 deletions

0 commit comments

Comments
 (0)