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

util: improve inspects RegExp support by BridgeAR · Pull Request #25192 · nodejs/node · GitHub

/ node Public

util: improve inspects RegExp support - #25192

Closed
BridgeAR wants to merge 2 commits into
nodejs:masterfrom
BridgeAR:improve-reg-exp-support
Closed

util: improve inspects RegExp support#25192
BridgeAR wants to merge 2 commits into
nodejs:masterfrom
BridgeAR:improve-reg-exp-support

Conversation

Copy link
Copy Markdown
Member

Please check the commit messages as description.

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

BridgeAR requested a review from antsmartian December 23, 2018 16:48

Copy link
Copy Markdown
Collaborator

nodejs-github-bot added the util Issues and PRs related to the built-in util module. label Dec 23, 2018
This adds support for inspect to distinguish regular expression
subclasses and ones with null prototype from "normal" regular
expressions.
So far we do not test all data types for subclasses and this extends
the existing tests for WeakSet, WeakMap and BigInt64Array.
BridgeAR force-pushed the improve-reg-exp-support branch from 9fd659e to eabee50 Compare December 23, 2018 17:29

Copy link
Copy Markdown
Member Author

Trott commented Dec 23, 2018
edited
Loading

Copy link
Copy Markdown
Member

AIX failure is a known issue (#24305). I'll open a PR to mark it as flaky.

Pi issue is a new one. It's a crash rather than a simpler test failure and it could be something unrelated to the test itself. Will open an issue for it to track if it recurs.

Resume Build CI: https://ci.nodejs.org/job/node-test-pull-request/19769/ ✔️

const expectedWithoutProto = `[${base.name}: null prototype] ${rawExpected}`;
assert.strictEqual(util.inspect(value), expected);
value.foo = 'bar';
assert.notStrictEqual(util.inspect(value), expected);

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

One small suggestion: may be we want to pull out the test cases for properties in a separate block. Would be happy to see strictEqual rather than notStrictEqual(as it can silently fail on wrong op's).

Copy link
Copy Markdown
Member 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

We have lots of tests which verify that the properties are actually displayed correct and they always hit the same code path. Therefore verifying that it's a different result should be sufficient.
Below there's also another test to verify that at least the property is indeed displayed as expected.

The reason for not using the strict comparison here is that each data type has different ways of displaying some parts and it's difficult to generalize that.

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

Sure, it is sufficient as you said above but thought it could be better using strictEqual. Anyways this is not a blocker to land.

antsmartian 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

LGTM

antsmartian added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Dec 24, 2018

Copy link
Copy Markdown
Member Author

@nodejs/util PTAL.

This needs another review.

BridgeAR added a commit to BridgeAR/node that referenced this pull request Dec 27, 2018
This adds support for inspect to distinguish regular expression
subclasses and ones with null prototype from "normal" regular
expressions.

PR-URL: nodejs#25192
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
BridgeAR added a commit to BridgeAR/node that referenced this pull request Dec 27, 2018
So far we do not test all data types for subclasses and this extends
the existing tests for WeakSet, WeakMap and BigInt64Array.

PR-URL: nodejs#25192
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

Copy link
Copy Markdown
Member Author

Landed in bd13afb and c9d08c7

BridgeAR closed this Dec 27, 2018
targos pushed a commit that referenced this pull request Jan 1, 2019
This adds support for inspect to distinguish regular expression
subclasses and ones with null prototype from "normal" regular
expressions.

PR-URL: #25192
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this pull request Jan 1, 2019
So far we do not test all data types for subclasses and this extends
the existing tests for WeakSet, WeakMap and BigInt64Array.

PR-URL: #25192
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
refack pushed a commit to refack/node that referenced this pull request Jan 14, 2019
This adds support for inspect to distinguish regular expression
subclasses and ones with null prototype from "normal" regular
expressions.

PR-URL: nodejs#25192
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
refack pushed a commit to refack/node that referenced this pull request Jan 14, 2019
So far we do not test all data types for subclasses and this extends
the existing tests for WeakSet, WeakMap and BigInt64Array.

PR-URL: nodejs#25192
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
BridgeAR mentioned this pull request Jan 16, 2019
MylesBorins mentioned this pull request Jan 24, 2019
BridgeAR deleted the improve-reg-exp-support branch January 20, 2020 11:48
BridgeAR restored the improve-reg-exp-support branch January 20, 2020 11:49
BridgeAR deleted the improve-reg-exp-support branch January 20, 2020 11:49
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

author ready PRs that have at least one approval, no outstanding review comments, 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.

6 participants


Back | FazBrowse Home | New Git URL