Skip to content

util: add null prototype support for date#25144

Closed
antsmartian wants to merge 1 commit into
nodejs:masterfrom
antsmartian:date_util
Closed

util: add null prototype support for date#25144
antsmartian wants to merge 1 commit into
nodejs:masterfrom
antsmartian:date_util

Conversation

@antsmartian

@antsmartian antsmartian commented Dec 20, 2018

Copy link
Copy Markdown
Contributor

Adds the support of null prototype in Date object.

cc @BridgeAR

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

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot nodejs-github-bot added the util Issues and PRs related to the built-in util module. label Dec 20, 2018

@BridgeAR BridgeAR left a comment

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.

Since invalid dates will now be handled properly with keys as well, please also add a test for that (as well as subclassing if implemented).

Comment thread lib/internal/util/inspect.js Outdated
Comment thread test/parallel/test-util-inspect.js Outdated
Comment thread lib/internal/util/inspect.js Outdated
@antsmartian antsmartian force-pushed the date_util branch 2 times, most recently from 43c8edf to 435415f Compare December 21, 2018 02:43
@antsmartian

Copy link
Copy Markdown
Contributor Author

@mscdex @BridgeAR PTAL...

@antsmartian

antsmartian commented Dec 21, 2018

Copy link
Copy Markdown
Contributor Author

@antsmartian antsmartian force-pushed the date_util branch 2 times, most recently from 2a9c063 to 5f8d3a9 Compare December 21, 2018 11:06

@BridgeAR BridgeAR left a comment

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.

This is LG to me if the keys.length === 0 check is removed (the original conditional was a mistake in the first place and with the current implementation it produces a weird output).

Comment thread lib/internal/util/inspect.js Outdated
Comment thread test/parallel/test-util-inspect.js Outdated
@antsmartian antsmartian force-pushed the date_util branch 2 times, most recently from 840315d to 58b2aba Compare December 21, 2018 12:33

@BridgeAR BridgeAR left a comment

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.

LGTM

@antsmartian

antsmartian commented Dec 21, 2018

Copy link
Copy Markdown
Contributor Author

Thanks for guiding me here @BridgeAR. I love utils, may be few more PR's on the way!

I guess we are now left with RE and Errors null proto handling. Will try out working on RE and send out a PR in a few days.

@antsmartian

Copy link
Copy Markdown
Contributor Author

@jdalton

jdalton commented Dec 21, 2018

Copy link
Copy Markdown
Member

I've had this bite me for other non-date values. Might be a good time to review other places this can happen.

@antsmartian

Copy link
Copy Markdown
Contributor Author

@jdalton Yes. We have already support for other types apart from Error and RE.

@antsmartian

antsmartian commented Dec 22, 2018

Copy link
Copy Markdown
Contributor Author

@Trott Trott added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 22, 2018
@BridgeAR

Copy link
Copy Markdown
Member

@nodejs/util this could use another LG.

@antsmartian this needs a rebase.

@addaleax addaleax removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 31, 2018
@antsmartian

Copy link
Copy Markdown
Contributor Author

New CI After Rebase: https://ci.nodejs.org/job/node-test-pull-request/19966/

@antsmartian

Copy link
Copy Markdown
Contributor Author

@antsmartian

Copy link
Copy Markdown
Contributor Author

Fresh CI (after rebase due to conflict): https://ci.nodejs.org/job/node-test-pull-request/20009/

@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 9, 2019
@antsmartian

Copy link
Copy Markdown
Contributor Author

@BridgeAR @jasnell Rebased the codebase, do you want to have a look once before I land this? I'm planning to land it soon.

Comment thread test/parallel/test-util-inspect.js Outdated
@antsmartian

Copy link
Copy Markdown
Contributor Author

@BridgeAR

Copy link
Copy Markdown
Member

Landed in 81b25ea 🎉

@BridgeAR BridgeAR closed this Jan 10, 2019
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request Jan 10, 2019
PR-URL: nodejs#25144
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
@antsmartian antsmartian deleted the date_util branch January 10, 2019 02:49
addaleax pushed a commit that referenced this pull request Jan 14, 2019
PR-URL: #25144
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
@BridgeAR BridgeAR mentioned this pull request Jan 16, 2019
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request Jan 16, 2019
PR-URL: nodejs#25144
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. util Issues and PRs related to the built-in util module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants