Skip to content
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 quits unexpectedly during tab completion #3346

Closed
usernameisalreadytaken2014 opened this issue Oct 13, 2015 · 6 comments
Closed

REPL quits unexpectedly during tab completion #3346

usernameisalreadytaken2014 opened this issue Oct 13, 2015 · 6 comments
Labels
confirmed-bug Issues with confirmed bugs. repl Issues and PRs related to the REPL subsystem.

Comments

@usernameisalreadytaken2014

Reproduction:

  1. Start the nodejs repl.
  2. Start a function; enter "function() {" (without quotes) and hit [ENTER].
  3. Type "arguments." (without quotes) and hit [TAB].

Expected:
Available properties on arguments object, varying depending on strict / non-strict mode.

Actual:
Exit to command prompt with exit code 0.

Screenshot:

~ $ nodejs
> function() {
... arguments.~ $ echo $?
0

Version:
NodeJS 4.1 on Linux 3.19

@mscdex mscdex added repl Issues and PRs related to the REPL subsystem. confirmed-bug Issues with confirmed bugs. labels Oct 13, 2015
@mscdex
Copy link
Contributor

mscdex commented Oct 13, 2015

Looks like this bug has existed since v0.12.

@Trott
Copy link
Member

Trott commented Oct 13, 2015

Looks like problems started with c0721bc which introduced domains into the REPL error handling.

@Trott
Copy link
Member

Trott commented Oct 13, 2015

At the point where tab completion is requested, arguments is undefined because the function has not been invoked. Until the function is invoked, there's no way to know if arguments will contain a 0 property, a 10 property, or what.

Node v0.10.40 would do nothing when you hit tab to get properties on an undefined value.

Current Node throws a ReferenceError.

So I think the fix to this bug will/should throw a ReferenceError rather than display results.

@Trott
Copy link
Member

Trott commented Oct 14, 2015

PR #3358 is intended to fix this bug.

Trott added a commit to Trott/io.js that referenced this issue Oct 21, 2015
If a tab completion is attempted on an undefined reference inside of a
function, the REPL was exiting without reporting an error or anything
else. This change results in the REPL reporting the ReferenceError and
continuing.

Fixes: nodejs#3346
PR-URL: nodejs#3358
Reviewed-By: James M Snell <jasnell@gmail.com>
@Trott
Copy link
Member

Trott commented Oct 21, 2015

Fixed in #3358.

Trott added a commit that referenced this issue Oct 22, 2015
If a tab completion is attempted on an undefined reference inside of a
function, the REPL was exiting without reporting an error or anything
else. This change results in the REPL reporting the ReferenceError and
continuing.

Fixes: #3346
PR-URL: #3358
Reviewed-By: James M Snell <jasnell@gmail.com>
@usernameisalreadytaken2014
Copy link
Author

Nice, thanks! :-)

Impressive response time.

Trott added a commit that referenced this issue Oct 26, 2015
If a tab completion is attempted on an undefined reference inside of a
function, the REPL was exiting without reporting an error or anything
else. This change results in the REPL reporting the ReferenceError and
continuing.

Fixes: #3346
PR-URL: #3358
Reviewed-By: James M Snell <jasnell@gmail.com>
Trott added a commit that referenced this issue Oct 29, 2015
If a tab completion is attempted on an undefined reference inside of a
function, the REPL was exiting without reporting an error or anything
else. This change results in the REPL reporting the ReferenceError and
continuing.

Fixes: #3346
PR-URL: #3358
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed-bug Issues with confirmed bugs. repl Issues and PRs related to the REPL subsystem.
Projects
None yet
Development

No branches or pull requests

4 participants