-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
repl: '...' should not be detected as REPL keyword #14426
Comments
I take this up ... |
This fix makes ... in REPL to be considered as a javascript construct rather than a REPL keyword Fixes: nodejs#14426
I've modified REPL so that
But on
What could be the reason ? |
@shivanth I'm not sure 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 |
@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:
|
Which is pretty weird in itself imho, but yes, this seems to be the correct behaviour right now. |
This fix makes ... in REPL to be considered as a javascript construct rather than a REPL keyword. Fixes: #14426 PR-URL: #14467 Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
This fix makes ... in REPL to be considered as a javascript construct rather than a REPL keyword. Fixes: nodejs#14426 PR-URL: nodejs#14467 Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
This fix makes ... in REPL to be considered as a javascript construct rather than a REPL keyword. Fixes: #14426 Backport-PR-URL: #14915 PR-URL: #14467 Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
Should instead throw this error:
$ node -p '...[]' [eval]:1 ...[] ^^^ SyntaxError: Unexpected token ...
The text was updated successfully, but these errors were encountered: