Skip to content

REPL quits unexpectedly during tab completion #3346

Description

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

Activity

  1. added
    replIssues and PRs related to the REPL subsystem.
    confirmed-bugIssues and PRs for confirmed bugs.
    on Oct 13, 2015
  2. mscdex commented on Oct 13, 2015

    @mscdex
    Contributor

    Looks like this bug has existed since v0.12.

  3. Trott commented on Oct 13, 2015

    @Trott
    Member

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

  4. Trott commented on Oct 13, 2015

    @Trott
    Member

    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.

  5. Trott commented on Oct 14, 2015

    @Trott
    Member

    PR #3358 is intended to fix this bug.

  6. Trott commented on Oct 21, 2015

    @Trott
    Member

    Fixed in #3358.

  7. added a commit that references this issue on Oct 22, 2015
  8. usernameisalreadytaken2014 commented on Oct 26, 2015

    @usernameisalreadytaken2014
    Author

    Nice, thanks! :-)

    Impressive response time.

  9. added a commit that references this issue on Oct 26, 2015
  10. added a commit that references this issue on Oct 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues and PRs for confirmed bugs.replIssues and PRs related to the REPL subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions