GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — repl: small refactoring by BridgeAR · Pull Request #17919 · nodejs/node

Conversation

@BridgeAR

@BridgeAR BridgeAR commented Dec 30, 2017

Copy link
Copy Markdown
Member

Just a minor refactoring to make the code more pleasant.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

repl

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
BridgeAR added 2 commits December 30, 2017 03:20
@BridgeAR
repl: upper case comments first char
bd39e91
@BridgeAR
repl: refactor code for readability
9bf7fdb
@nodejs-github-bot nodejs-github-bot added the repl Issues and PRs related to the REPL subsystem. label Dec 30, 2017
jasnell
jasnell approved these changes Dec 30, 2017
View reviewed changes
tniessen
tniessen approved these changes Dec 30, 2017
View reviewed changes
lpinca
lpinca approved these changes Dec 30, 2017
View reviewed changes
starkwang
starkwang approved these changes Dec 30, 2017
View reviewed changes
cjihrig
cjihrig reviewed Dec 30, 2017
View reviewed changes
Comment thread lib/repl.js Outdated
}
} catch (e) {
//console.log("completion error walking prototype chain:" + e);
// console.log("completion error walking prototype chain:" + e);

@cjihrig cjihrig Dec 30, 2017

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Why not just remove this?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

tniessen and maclover7 reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

@BridgeAR BridgeAR Jan 2, 2018

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Done

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread lib/repl.js
}
// We're given a duplex readable/writable Stream, like a `net.Socket`
// or a custom object with 2 streams, or the `process` object
input = stream.stdin || stream;

@cjihrig cjihrig Dec 30, 2017

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

It probably doesn't make a difference, but this has the potential to be a behavior change if only one of stream.stdin or stream.stdout were passed in.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

apapirovski reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@BridgeAR BridgeAR Jan 2, 2018

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Hm, do you want me to change it to the way it was before? I personally do not feel like this is ever going to matter.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
XadillaX
XadillaX approved these changes Dec 31, 2017
View reviewed changes
maclover7
maclover7 approved these changes Dec 31, 2017
View reviewed changes

@maclover7 maclover7 left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM except for @cjihrig's 2 comments.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
vikkyconer
vikkyconer suggested changes Jan 1, 2018
View reviewed changes
Comment thread lib/repl.js Outdated
memberGroups[i].map((member) => expr + '.' + member));
}
if (filter) {
filter = expr + '.' + filter;

@vikkyconer vikkyconer Jan 1, 2018 •
edited by tniessen
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

filter = expr + '.' + filter;

This can be changed to

filter = `${ expr }.${ filter }`;

Since it removes access usage of +

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@BridgeAR BridgeAR Jan 2, 2018

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Done

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread lib/repl.js Outdated
return expr + '.' + member;
}));
completionGroups.push(
memberGroups[i].map((member) => expr + '.' + member));

@vikkyconer vikkyconer Jan 1, 2018 •
edited by tniessen
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

const foo = memberGroups.reduce(( acc, memberGroup ) => {
    acc.push(memberGroup.map((member) => `${ expr }.${ member }`));
    return acc;
}, []);
completionGroups.concat(foo);

Don't mind the name foo as could not think of some descent name but this will make the code immutable. Although we are mutating completionGroups array but in next change we can convert it also to immutability

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@BridgeAR BridgeAR Jan 2, 2018

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

That is not necessary out of my perspective. I personally feel the current code is more expressive than using reduce.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vikkyconer reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@BridgeAR
fixup address comments
d8c95ca
@BridgeAR

BridgeAR commented Jan 2, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@BridgeAR BridgeAR added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Jan 2, 2018
vikkyconer
vikkyconer approved these changes Jan 2, 2018
View reviewed changes
lance
lance approved these changes Jan 4, 2018
View reviewed changes
@BridgeAR

BridgeAR commented Jan 4, 2018

Copy link
Copy Markdown
Member Author

Landed in 11dda69, 80988f9

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@BridgeAR BridgeAR closed this Jan 4, 2018
BridgeAR added a commit to BridgeAR/node that referenced this pull request Jan 4, 2018
@BridgeAR
repl: upper case comments first char
80988f9
PR-URL: nodejs#17919
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Weijia Wang <[email protected]>
Reviewed-By: Khaidi Chu <[email protected]>
Reviewed-By: Jon Moss <[email protected]>
Reviewed-By: Lance Ball <[email protected]>
BridgeAR added a commit to BridgeAR/node that referenced this pull request Jan 4, 2018
@BridgeAR
repl: refactor code for readability
11dda69
PR-URL: nodejs#17919
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Weijia Wang <[email protected]>
Reviewed-By: Khaidi Chu <[email protected]>
Reviewed-By: Jon Moss <[email protected]>
Reviewed-By: Lance Ball <[email protected]>
@MylesBorins MylesBorins added the backport-requested-v9.x label Jan 9, 2018
@MylesBorins

MylesBorins commented Jan 9, 2018

Copy link
Copy Markdown
Contributor

this does not land cleanly on v9.x, could you please backport?

as an aside @BridgeAR it appears you are listing the commits in the reverse order they landed... which can make things confusing when landing on release branches. In future could you post the commits in chronological order, or alternatively using the range syntax [headbefore]...[headafter]

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@TimothyGu TimothyGu removed the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Jan 13, 2018
@BridgeAR BridgeAR mentioned this pull request Mar 8, 2018
[v9.x backport] This is backporting multiple commits that were requested #19244
Closed
4 tasks done
@BridgeAR

BridgeAR commented Mar 10, 2018

Copy link
Copy Markdown
Member Author

Backported in #19244 (about the order: I fixed that a while ago in my script. It is always in chronological order again).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

BridgeAR added a commit to BridgeAR/node that referenced this pull request Mar 21, 2018
@BridgeAR
repl: upper case comments first char
976823c
PR-URL: nodejs#17919
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Weijia Wang <[email protected]>
Reviewed-By: Khaidi Chu <[email protected]>
Reviewed-By: Jon Moss <[email protected]>
Reviewed-By: Lance Ball <[email protected]>
BridgeAR added a commit to BridgeAR/node that referenced this pull request Mar 21, 2018
@BridgeAR
repl: refactor code for readability
6086e71
PR-URL: nodejs#17919
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Weijia Wang <[email protected]>
Reviewed-By: Khaidi Chu <[email protected]>
Reviewed-By: Jon Moss <[email protected]>
Reviewed-By: Lance Ball <[email protected]>
MylesBorins pushed a commit that referenced this pull request Mar 21, 2018
@BridgeAR @MylesBorins
repl: upper case comments first char
6997af7
Backport-PR-URL: #19244
PR-URL: #17919
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Weijia Wang <[email protected]>
Reviewed-By: Khaidi Chu <[email protected]>
Reviewed-By: Jon Moss <[email protected]>
Reviewed-By: Lance Ball <[email protected]>
MylesBorins pushed a commit that referenced this pull request Mar 21, 2018
@BridgeAR @MylesBorins
repl: refactor code for readability
55f7bbb
Backport-PR-URL: #19244
PR-URL: #17919
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Weijia Wang <[email protected]>
Reviewed-By: Khaidi Chu <[email protected]>
Reviewed-By: Jon Moss <[email protected]>
Reviewed-By: Lance Ball <[email protected]>
@MylesBorins MylesBorins added backported-to-v9.x and removed backport-requested-v9.x labels Mar 21, 2018
@targos targos mentioned this pull request Mar 21, 2018
v9.9.0 proposal #19428
Merged
@MylesBorins MylesBorins added the backport-requested-v8.x label Jul 31, 2018
@MylesBorins

MylesBorins commented Jul 31, 2018

Copy link
Copy Markdown
Contributor

Backport requested for 8.x in #19244

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@BridgeAR
BridgeAR deleted the refactor-repl branch April 1, 2019 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cjihrig cjihrig cjihrig left review comments
@jasnell jasnell jasnell approved these changes
@lpinca lpinca lpinca approved these changes
@XadillaX XadillaX XadillaX approved these changes
@tniessen tniessen tniessen approved these changes
+4 more reviewers
@lance lance lance approved these changes
@maclover7 maclover7 maclover7 approved these changes
@vikkyconer vikkyconer vikkyconer approved these changes
@starkwang starkwang starkwang approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

repl Issues and PRs related to the REPL subsystem.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

13 participants

@BridgeAR @MylesBorins @lance @jasnell @lpinca @cjihrig @XadillaX @maclover7 @tniessen @vikkyconer @starkwang @TimothyGu @nodejs-github-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.