Skip to content

repl: handle dot commands syntax error for multiline inputs#63911

Open
SudhansuBandha wants to merge 3 commits into
nodejs:mainfrom
SudhansuBandha:dot-commands-multiline-SyntaxError-fix
Open

repl: handle dot commands syntax error for multiline inputs#63911
SudhansuBandha wants to merge 3 commits into
nodejs:mainfrom
SudhansuBandha:dot-commands-multiline-SyntaxError-fix

Conversation

@SudhansuBandha

Copy link
Copy Markdown
Contributor

Fixes: #63864
Refs: #63889

Update conditional logic to correctly handle dot commands in multiline REPL input

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. repl Issues and PRs related to the REPL subsystem. labels Jun 14, 2026
@SudhansuBandha SudhansuBandha force-pushed the dot-commands-multiline-SyntaxError-fix branch 5 times, most recently from 9279b81 to 8141b1d Compare June 14, 2026 11:14
@SudhansuBandha SudhansuBandha force-pushed the dot-commands-multiline-SyntaxError-fix branch from 8141b1d to 4fa9ef6 Compare June 15, 2026 06:07
Update conditional logic to correctly handle dot commands
in multiline REPL input

Fixes: nodejs#63864
Refs: nodejs#63889
Signed-off-by: SudhansuBandha <bandhasudhansu@gmail.com>
@SudhansuBandha SudhansuBandha force-pushed the dot-commands-multiline-SyntaxError-fix branch from 30d239b to 738694b Compare June 15, 2026 10:39

@avinashkamat48 avinashkamat48 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can treat ordinary JavaScript property access as a REPL dot command whenever the property name matches a command. For example, obj .help is valid JS member access with whitespace before the dot, but isDotCommandAfterWhitespace plus the regex will extract help and run the REPL help command instead of evaluating the expression. The multiline case should likely only recognize a dot command when the dot begins a logical input line after optional indentation. Please add a regression test for obj .help / obj .break staying as JavaScript.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. repl Issues and PRs related to the REPL subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

REPL: dot-commands produce SyntaxError inside multi-line input

3 participants