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: allow recovery for wrapped eval #31990

Closed
wants to merge 1 commit into from

Conversation

codebytere
Copy link
Member

@codebytere codebytere commented Feb 27, 2020

Follow-up to #31943.

In the PR above, repl eval was altered to eagerly try and wrap code with parens, but this could in some cases cause failures for code which is only valid JavaScript in an unwrapped state.

This PR makes that logic more robust by ensuring that the wrapped code is parsed to be valid JS before evaluation continues, and proceeds unwrapped if it is found to be invalid.

cc @devsnek @BridgeAR

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

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

Is this actually necessary? The code is first checked as wrapped code and in case that fails it is run unwrapped.

@codebytere
Copy link
Member Author

Hmm looks like you're right - I was proceeding on the assumption it was based on the original issue but i think that was just my misreading! Closing :)

@codebytere codebytere closed this Mar 2, 2020
@codebytere codebytere deleted the repl-preview-try-again branch March 2, 2020 17:23
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.

None yet

3 participants