FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Backport: repl: don't override all internal repl defaults by cjihrig · Pull Request #9774 · nodejs/node · GitHub

/ node Public

Backport: repl: don't override all internal repl defaults - #9774

Closed
cjihrig wants to merge 2 commits into
nodejs:v4.x-stagingfrom
cjihrig:7826bp
Closed

Backport: repl: don't override all internal repl defaults#9774
cjihrig wants to merge 2 commits into
nodejs:v4.x-stagingfrom
cjihrig:7826bp

Conversation

cjihrig commented Nov 23, 2016

Copy link
Copy Markdown
Contributor

This is a backport of #7826 to v4.

R= @thealphanerd

This commit adds a function to test/common.js that allows
additional global variables to be whitelisted in a test.

PR-URL: nodejs#7826
Reviewed-By: James M Snell <jasnell@gmail.com>
The createInternalRepl() module accepts an options object as an
argument. However, if one is provided, it overrides all of the
default options. This commit applies the options object to the
defaults, only changing the values that are explicitly set.

PR-URL: nodejs#7826
Reviewed-By: James M Snell <jasnell@gmail.com>
nodejs-github-bot added repl Issues and PRs related to the REPL subsystem. v4.x labels Nov 23, 2016
Comment thread lib/internal/repl.js
opts = null;
}
opts = opts || {
opts = util._extend({

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I'm curious why you wouldn't just use Object.assign here. Looking at the source of util._extend it looks to be identical. What am I missing?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Object.assign() was shown to be slower in a few previous issues.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

If not in critical path, May be Object.assign() is ok enough.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This is a backport, so I don't think it's a good idea to change things here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

+1 If you have problem with implementation fix on master and it can come in another backport

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks for the info. Just for the record, I asked out of curiosity - not because I expected it to change. I had no idea that Object.assign was slower. To see for myself, I ran some tests and also found that to be the case. Thanks for the clarification.

Copy link
Copy Markdown
Contributor

LGTM

MylesBorins commented Dec 13, 2016
edited
Loading

Copy link
Copy Markdown
Contributor

landed in 7b4268b...698bf2e

cjihrig deleted the 7826bp branch December 20, 2016 22:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL