Repository navigation
repl: '...' should not be detected as REPL keyword #14426
Description
Activity
- addedgood first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.replIssues and PRs related to the REPL subsystem.Issues and PRs related to the REPL subsystem.
on Jul 22, 2017 I take this up ...
Reacted by silverwind- added a commit that references this issue
on Jul 23, 2017 I've modified REPL so that
...is not considered as a REPL keyword anymore.
I'm seeing different behviours on REPL ofnode inspect -pandnode. On the inspector I see the expecteddebug> ...[] ...[] ^^^ SyntaxError: Unexpected token ...But on
nodeREPL, I see that it's expecting more input> ...[] ...What could be the reason ?
@shivanth I'm not sure
...[]is valid expression.[...[]]is...
The inspect console is a special REPL implemented bynode-inspectso it behaves different than the regular REPL. They are both trying to say that...[]is an invalid expression.d:\code\node-cur$ node -e "...[]" [eval]:1 ...[] ^^^ SyntaxError: Unexpected token ... at createScript (vm.js:74:10) at Object.runInThisContext (vm.js:116:10) at Object.<anonymous> ([eval]-wrapper:6:22) at Module._compile (module.js:569:30) at evalScript (bootstrap_node.js:432:27) at startup (bootstrap_node.js:139:9) at bootstrap_node.js:575:3 d:\code\node-cur$ node -e "(...[])" [eval]:1 (...[]) ^^^ SyntaxError: Unexpected token ... at createScript (vm.js:74:10) at Object.runInThisContext (vm.js:116:10) at Object.<anonymous> ([eval]-wrapper:6:22) at Module._compile (module.js:569:30) at evalScript (bootstrap_node.js:432:27) at startup (bootstrap_node.js:139:9) at bootstrap_node.js:575:3 d:\code\node-cur$ node -e "[...[]]" d:\code\node-cur$ echo %ERRORLEVEL% 0
P.S. IMHO what you showed in the comment #14426 (comment) above is the correct behaviour
- addedconfirmed-bugIssues and PRs for confirmed bugs.Issues and PRs for confirmed bugs.
on Jul 24, 2017 @refack , you mean to say that the REPL should wait for more input after seeing
...[]?@refack , you mean to say that the REPL should wait for more input after seeing ...[] ?
I think so... That's how the REPL behaves with invalid expressions:
> var o = {a:1}} ...That's how the REPL behaves with invalid expressions
Which is pretty weird in itself imho, but yes, this seems to be the correct behaviour right now.
- added a commit that references this issue
on Jul 29, 2017 - added a commit that references this issue
on Aug 18, 2017 - added a commit that references this issue
on Sep 19, 2017

Should instead throw this error:
$ node -p '...[]' [eval]:1 ...[] ^^^ SyntaxError: Unexpected token ...