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

errors: add duplicate symbol checking in E() and increase coverage by DavidCai1111 · Pull Request #11829 · nodejs/node · GitHub

/ node Public

errors: add duplicate symbol checking in E() and increase coverage - #11829

Closed
DavidCai1111 wants to merge 1 commit into
nodejs:masterfrom
DavidCai1111:errors/check-used-sym
Closed

errors: add duplicate symbol checking in E() and increase coverage#11829
DavidCai1111 wants to merge 1 commit into
nodejs:masterfrom
DavidCai1111:errors/check-used-sym

Conversation

Copy link
Copy Markdown
Member

Add duplicate error symbol checking in E() to avoid potential confusing result.

Improve coverage of internal/errors.js.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

errors

nodejs-github-bot added the errors Issues and PRs related to JavaScript errors originated in Node.js core. label Mar 13, 2017
Comment thread test/parallel/test-internal-errors.js Outdated

mscdex Mar 13, 2017
edited
Loading

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

FWIW you could move the arguments to new (indented) lines to avoid new RegExp() and string concatenation:

assert.throws(
  () => errors.E('TEST_ERROR_USED_SYMBOL'),
  /^AssertionError: Error symbol: TEST_ERROR_USED_SYMBOL was used\.$/);

mscdex commented Mar 13, 2017

Copy link
Copy Markdown
Contributor

The first line of the commit message exceeds 50 characters.

DavidCai1111 force-pushed the errors/check-used-sym branch 3 times, most recently from 14348ce to 1e4ab50 Compare March 13, 2017 15:55

Copy link
Copy Markdown
Member Author

@mscdex Thanks for reviewing. Updated, PTAL.

Comment thread test/parallel/test-internal-errors.js Outdated

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

The period should be escaped to avoid matching any character instead of a literal period.

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

Oh...Sorry for forgetting that. Updated.

DavidCai1111 force-pushed the errors/check-used-sym branch from 1e4ab50 to ffbd3a3 Compare March 13, 2017 16:04
DavidCai1111 changed the title errors: add duplicate symbol checking in E() and improve coverage errors: add duplicate symbol checking in E() and increase coverage Mar 13, 2017
Comment thread lib/internal/errors.js Outdated

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

maybe "was used before" or "was already used" ?

DavidCai1111 Mar 13, 2017
edited
Loading

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

@targos Thanks for reviewing. Changed to "was already used", PTAL.

Add duplicate symbol checking in E() to avoid potential confusing result. Increase coverage of internal/errors.
DavidCai1111 force-pushed the errors/check-used-sym branch from ffbd3a3 to a907059 Compare March 13, 2017 16:13

mscdex commented Mar 13, 2017

Copy link
Copy Markdown
Contributor

fhinkel commented Mar 15, 2017

Copy link
Copy Markdown
Contributor

Thanks. Landed in b5eccc4

fhinkel closed this Mar 15, 2017
fhinkel pushed a commit that referenced this pull request Mar 15, 2017
Add duplicate symbol checking in E() to avoid potential confusing
result. Increase coverage of internal/errors.

PR-URL: #11829
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Mar 20, 2017
Add duplicate symbol checking in E() to avoid potential confusing
result. Increase coverage of internal/errors.

PR-URL: nodejs#11829
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
jungx098 pushed a commit to jungx098/node that referenced this pull request Mar 21, 2017
Add duplicate symbol checking in E() to avoid potential confusing
result. Increase coverage of internal/errors.

PR-URL: nodejs#11829
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>

Copy link
Copy Markdown
Contributor

Doesn't land on v6.x afaict. If it does land somewhere else in the tree lmk

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

errors Issues and PRs related to JavaScript errors originated in Node.js core.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants


Back | FazBrowse Home | New Git URL