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: assign underscore fix #3737

Closed

Commits on Feb 25, 2016

  1. repl: pre-define _ in REPL's context

    As `_` is not defined in REPL's context, when it is defined as `const`,
    it breaks REPL, as it tries to store the result of the last evaluated
    expression in `_`. This patch makes sure that `_` is pre-defined in
    REPL's context, so that if users define it again, they will get error.
    
    Refer: nodejs#3729
    Refer: nodejs#3704
    thefourtheye committed Feb 25, 2016
    Configuration menu
    Copy the full SHA
    bcfa885 View commit details
    Browse the repository at this point in the history
  2. test: make sure _ cannot be defined in REPL

    If the `_` is redefined as `const` in REPL, it will break the REPL, as
    REPL will store the result of the last evaluated expression in `_`.
    This patch has a test to make sure that the REPL doesn't allow
    redefining `_` as `const`, also still assiging values to `_` is
    permitted.
    
    Refer: nodejs#3729
    Refer: nodejs#3704
    thefourtheye committed Feb 25, 2016
    Configuration menu
    Copy the full SHA
    c2a3731 View commit details
    Browse the repository at this point in the history
  3. doc: warn about reassigning _ in REPL

    When users assign a value to `_` in REPL, it is prone to unexpected
    results or messing up with REPL's internals. For example,
    nodejs#3704. This patch issues a warning
    about the same.
    thefourtheye committed Feb 25, 2016
    Configuration menu
    Copy the full SHA
    48d79a4 View commit details
    Browse the repository at this point in the history