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: eager-evaluate input in parens #31943

Closed
wants to merge 1 commit into from

Conversation

codebytere
Copy link
Member

Refs #31820.

This PR updates repl evaluation to eagerly wrap all input in parentheses and adds a regression test using the example given in the above issue. I plan to open a follow-up PR to allow the preview to evaluate the code again unwrapped if the first attempt fails.

cc @BridgeAR @devsnek

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the repl Issues and PRs related to the REPL subsystem. label Feb 25, 2020
Copy link
Member

@devsnek devsnek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there's an immediately obvious behaviour to have here so just aligning the two evaluators is good enough imo.

Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM besides the mentioned whitespace issue. It should be handled identically when previewing and actually evaluating the code.

lib/repl.js Outdated Show resolved Hide resolved
test/parallel/test-repl-preview.js Outdated Show resolved Hide resolved
@nodejs-github-bot
Copy link
Collaborator

@codebytere
Copy link
Member Author

Landed in 20a51b9

@codebytere codebytere closed this Feb 27, 2020
codebytere added a commit that referenced this pull request Feb 27, 2020
PR-URL: #31943
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
@codebytere codebytere deleted the fix-repl-eval-issue branch February 27, 2020 05:11
codebytere added a commit that referenced this pull request Feb 27, 2020
PR-URL: #31943
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
@targos
Copy link
Member

targos commented Apr 18, 2020

depends on the repl preview changes to land on v12.x

targos pushed a commit to targos/node that referenced this pull request Apr 25, 2020
PR-URL: nodejs#31943
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
targos pushed a commit that referenced this pull request Apr 28, 2020
PR-URL: #31943
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
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.

6 participants