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

@antsmartianantsmartian 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-botnodejs-github-bot added the util Issues and PRs related to the built-in util module. label Dec 20, 2018

@BridgeARBridgeAR 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 threadlib/internal/util/inspect.js Outdated
Comment threadtest/parallel/test-util-inspect.js Outdated
Comment threadlib/internal/util/inspect.js Outdated
@antsmartian
antsmartianforce-pushed the date_util branch 2 times, most recently from 43c8edf to 435415fCompareDecember 21, 2018 02:43
@antsmartian

Copy link
Copy Markdown
ContributorAuthor

@mscdex@BridgeAR PTAL...

@antsmartian

antsmartian commented Dec 21, 2018

Copy link
Copy Markdown
ContributorAuthor

@antsmartian
antsmartianforce-pushed the date_util branch 2 times, most recently from 2a9c063 to 5f8d3a9CompareDecember 21, 2018 11:06

@BridgeARBridgeAR 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 threadlib/internal/util/inspect.js Outdated
Comment threadtest/parallel/test-util-inspect.js Outdated
@antsmartian
antsmartianforce-pushed the date_util branch 2 times, most recently from 840315d to 58b2abaCompareDecember 21, 2018 12:33

@BridgeARBridgeAR 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
ContributorAuthor

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
ContributorAuthor

@jdalton

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
ContributorAuthor

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

@antsmartian

antsmartian commented Dec 22, 2018

Copy link
Copy Markdown
ContributorAuthor

@TrottTrott 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.

@addaleaxaddaleax 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
ContributorAuthor

@antsmartian

Copy link
Copy Markdown
ContributorAuthor

@antsmartian

Copy link
Copy Markdown
ContributorAuthor

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

@BridgeARBridgeAR 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
ContributorAuthor

@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 threadtest/parallel/test-util-inspect.js Outdated
@antsmartian

Copy link
Copy Markdown
ContributorAuthor

@BridgeAR

Copy link
Copy Markdown
Member

Landed in 81b25ea 🎉

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>
@BridgeARBridgeAR 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>
@MylesBorinsMylesBorins mentioned this pull request Jan 24, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@antsmartian@nodejs-github-bot@jdalton@BridgeAR@mscdex@jasnell@Trott@addaleax