Skip to content

Conversation

@DavidCai1111
Copy link
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-botnodejs-github-bot added the errors Issues and PRs related to JavaScript errors originated in Node.js core. label Mar 13, 2017
Copy link
Contributor

@mscdexmscdexMar 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:Errorsymbol:TEST_ERROR_USED_SYMBOLwasused\.$/);

@mscdex
Copy link
Contributor

The first line of the commit message exceeds 50 characters.

@DavidCai1111DavidCai1111force-pushed the errors/check-used-sym branch 3 times, most recently from 14348ce to 1e4ab50CompareMarch 13, 2017 15:55
@DavidCai1111
Copy link
MemberAuthor

@mscdex Thanks for reviewing. Updated, PTAL.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh...Sorry for forgetting that. Updated.

@DavidCai1111DavidCai1111 changed the title errors: add duplicate symbol checking in E() and improve coverageerrors: add duplicate symbol checking in E() and increase coverageMar 13, 2017
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
MemberAuthor

@DavidCai1111DavidCai1111Mar 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.
@mscdex
Copy link
Contributor

@fhinkel
Copy link
Member

Thanks. Landed in b5eccc4

@fhinkelfhinkel 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 <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
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 <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
@italoacasasitaloacasas mentioned this pull request Mar 20, 2017
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 <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
@MylesBorins
Copy link
Contributor

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

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

errorsIssues 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

@DavidCai1111@mscdex@fhinkel@MylesBorins@jasnell@targos@cjihrig@nodejs-github-bot@davidtaikocha