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: warn on assignment to _ #5438

Closed
wants to merge 1 commit into from
Closed

repl: warn on assignment to _ #5438

wants to merge 1 commit into from

Conversation

cjihrig
Copy link
Contributor

@cjihrig cjihrig commented Feb 25, 2016

Pull Request check-list

  • Does make -j8 test (UNIX) or vcbuild test nosign (Windows) pass with
    this change (including linting)?
  • Is the commit message formatted according to [CONTRIBUTING.md][0]?
  • If this change fixes a bug (or a performance problem), is a regression
    test (or a benchmark) included?
  • Is a documentation update included (if this change modifies
    existing APIs, or introduces new ones)?

Affected core subsystem(s)

repl

Description of change

The REPL uses _ to store the result of the previous expression. This can cause confusion for REPL users who assign libraries like Underscore and Lodash to _. The documentation already mentions this behavior. This commit adds a printed warning if the user assigns to _.

Refs: #5431

The REPL uses _ to store the result of the previous expression.
This can cause confusion for REPL users who assign libraries like
Underscore and Lodash to _. The documentation already mentions
this behavior. This commit adds a printed warning if the user
assigns to _.
@silverwind silverwind added the repl Issues and PRs related to the REPL subsystem. label Feb 25, 2016
@rvagg
Copy link
Member

rvagg commented Feb 26, 2016

How does this interact with #3737, is it one or the other?

@cjihrig
Copy link
Contributor Author

cjihrig commented Feb 26, 2016

@rvagg it looks like this subsumes #3737. I'm also seeing a few different behaviors, depending on the type of variable:

I think the varying behavior is related to #983.

@silverwind
Copy link
Contributor

Can't say I like this approach. I'd rather see something like #5431 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
repl Issues and PRs related to the REPL subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants