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

lib: use more primordials by aduh95 · Pull Request #35838 · nodejs/node · GitHub

/ node Public

lib: use more primordials - #35838

Closed
aduh95 wants to merge 1 commit into
nodejs:masterfrom
aduh95:refactor-function-calls-primordials
Closed

lib: use more primordials#35838
aduh95 wants to merge 1 commit into
nodejs:masterfrom
aduh95:refactor-function-calls-primordials

Conversation

aduh95 commented Oct 27, 2020
edited
Loading

Copy link
Copy Markdown
Contributor

This replaces all instances of Function.prototype.apply, Function.prototype.bind, and Function.prototype.call to their primordials alter ego.

I've used search and replace to make this PR, I've excluded changes in files that are already covered by other PRs (#35885, #35875, #35734). No test is being affected by this PR.

ReflectApply is used to replace Function.prototype.apply because it has less overhead (see #35838 (review)). There is an argument to be made that all Function.prototype.call calls could also be replaced by ReflectApply, but that's not done in this PR.

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

aduh95 added the request-ci Add this label to start a Jenkins CI on a PR. label Oct 27, 2020
nodejs-github-bot added the lib / src Issues and PRs related to general changes in the lib or src directory. label Oct 27, 2020

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto
  • @nodejs/http
  • @nodejs/net
  • @nodejs/startup

github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 27, 2020

Copy link
Copy Markdown
Collaborator

ExE-Boss left a comment

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

Instead of FunctionPrototypeApply, this should use ReflectApply, which doesn’t go through the uncurryThis closure:

function uncurryThis(func) {
return (thisArg, ...args) => ReflectApply(func, thisArg, args);
}

Comment thread lib/_http_client.js Outdated
aduh95 force-pushed the refactor-function-calls-primordials branch from 3b56f87 to 57c325a Compare October 29, 2020 20:13
aduh95 added the request-ci Add this label to start a Jenkins CI on a PR. label Oct 29, 2020
aduh95 marked this pull request as ready for review October 29, 2020 22:02
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 29, 2020

This comment has been minimized.

Copy link
Copy Markdown
Collaborator

aduh95 left a comment

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

I just realized there are some unnecessary whitespace changes.

Comment thread lib/dgram.js Outdated
Comment thread lib/internal/http2/core.js Outdated
Comment thread lib/internal/http2/core.js Outdated
Comment thread lib/internal/http2/core.js Outdated
Comment thread lib/internal/http2/core.js Outdated
Comment thread lib/internal/quic/core.js Outdated

Trott commented Oct 30, 2020

Copy link
Copy Markdown
Member

Needs a rebase.

aduh95 force-pushed the refactor-function-calls-primordials branch from 7ec460c to 8c2c47a Compare October 30, 2020 15:17
Trott added the request-ci Add this label to start a Jenkins CI on a PR. label Oct 31, 2020
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 31, 2020

This comment has been minimized.

nodejs-github-bot commented Oct 31, 2020
edited by aduh95
Loading

Copy link
Copy Markdown
Collaborator

aduh95 added the review wanted PRs that need reviews. label Nov 1, 2020
aduh95 force-pushed the refactor-function-calls-primordials branch from 8c2c47a to a3d70cd Compare November 3, 2020 09:21
This replaces all Function.prototype.apply, Function.prototype.bind,
Function.prototype.call to their primordials alter ego.
aduh95 force-pushed the refactor-function-calls-primordials branch from a3d70cd to 882e66e Compare November 6, 2020 10:29

aduh95 commented Nov 7, 2020

Copy link
Copy Markdown
Contributor Author

I'm going to split it into smaller PRs, that's too many files to review for a single PR of that kind.

aduh95 closed this Nov 7, 2020
aduh95 deleted the refactor-function-calls-primordials branch November 7, 2020 14:19
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

lib / src Issues and PRs related to general changes in the lib or src directory. review wanted PRs that need reviews.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL