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: Don’t complete non-simple expressions #6192

Conversation

addaleax
Copy link
Member

Checklist
  • tests and code linting passes
  • a test and/or benchmark is included
  • the commit message follows commit guidelines
Affected core subsystem(s)

repl

Description of change

Change the regular expression that recognizes “simple” JS expressions to requiring that the full line needs to match it.

Previously, in terms like a().b., b. would be a partial match. This meant that completion would evaluate b and either fail with a ReferenceError or, if b was some global, return the properties of the global b object.

Change the regular expression that recognizes “simple” JS expressions
to requiring that the full line needs to match it.

Previously, in terms like `a().b.`, `b.` would be a partial match.
This meant that completion would evaluate `b` and either fail with
a `ReferenceError` or, if `b` was some global, return the properties
of the global `b` object.
@mscdex mscdex added the repl Issues and PRs related to the REPL subsystem. label Apr 14, 2016
@cjihrig
Copy link
Contributor

cjihrig commented Apr 14, 2016

LGTM pending CI

@bnoordhuis
Copy link
Member

LGTM. This is not a fix for #6181, is it?

@addaleax
Copy link
Member Author

Yep, I’m pretty sure that’s unrelated.

@bnoordhuis
Copy link
Member

CI: https://ci.nodejs.org/job/node-test-pull-request/2259/

@cjihrig
Copy link
Contributor

cjihrig commented Apr 14, 2016

CI is green. Landed in 0b66b8f. Thanks!

@cjihrig cjihrig closed this Apr 14, 2016
cjihrig pushed a commit that referenced this pull request Apr 14, 2016
Change the regular expression that recognizes “simple” JS expressions
to requiring that the full line needs to match it.

Previously, in terms like `a().b.`, `b.` would be a partial match.
This meant that completion would evaluate `b` and either fail with
a `ReferenceError` or, if `b` was some global, return the properties
of the global `b` object.

PR-URL: #6192
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@addaleax addaleax deleted the repl-dont-complete-nonsimple-expressions branch April 14, 2016 18:41
MylesBorins pushed a commit that referenced this pull request Apr 19, 2016
Change the regular expression that recognizes “simple” JS expressions
to requiring that the full line needs to match it.

Previously, in terms like `a().b.`, `b.` would be a partial match.
This meant that completion would evaluate `b` and either fail with
a `ReferenceError` or, if `b` was some global, return the properties
of the global `b` object.

PR-URL: #6192
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
MylesBorins pushed a commit that referenced this pull request Apr 20, 2016
Change the regular expression that recognizes “simple” JS expressions
to requiring that the full line needs to match it.

Previously, in terms like `a().b.`, `b.` would be a partial match.
This meant that completion would evaluate `b` and either fail with
a `ReferenceError` or, if `b` was some global, return the properties
of the global `b` object.

PR-URL: #6192
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@MylesBorins MylesBorins mentioned this pull request Apr 20, 2016
MylesBorins pushed a commit that referenced this pull request Apr 20, 2016
Change the regular expression that recognizes “simple” JS expressions
to requiring that the full line needs to match it.

Previously, in terms like `a().b.`, `b.` would be a partial match.
This meant that completion would evaluate `b` and either fail with
a `ReferenceError` or, if `b` was some global, return the properties
of the global `b` object.

PR-URL: #6192
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@MylesBorins
Copy link
Contributor

@addaleax @jasnell @cjihrig lts?

@addaleax
Copy link
Member Author

Removing the lts-watch-v4.x label, that can be reconsidered when #6325 is resolved

@MylesBorins
Copy link
Contributor

I'm going to back this out of v5.11.0-proposal due to this regression

@addaleax
Copy link
Member Author

Hope I’m doing this right by tagging this PR as dont-land-on-5.x, because the best fix for this problem seems to be a semver-major one.

@MylesBorins
Copy link
Contributor

@addaleax that makes sense then. Thanks for taking the time!

jasnell pushed a commit that referenced this pull request Apr 26, 2016
Change the regular expression that recognizes “simple” JS expressions
to requiring that the full line needs to match it.

Previously, in terms like `a().b.`, `b.` would be a partial match.
This meant that completion would evaluate `b` and either fail with
a `ReferenceError` or, if `b` was some global, return the properties
of the global `b` object.

PR-URL: #6192
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
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.

5 participants