errors: add duplicate symbol checking in E() and increase coverage#11829
errors: add duplicate symbol checking in E() and increase coverage#11829DavidCai1111 wants to merge 1 commit intonodejs:masterfrom
Conversation
There was a problem hiding this comment.
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\.$/);|
The first line of the commit message exceeds 50 characters. |
14348ce to
1e4ab50
Compare
|
@mscdex Thanks for reviewing. Updated, PTAL. |
There was a problem hiding this comment.
The period should be escaped to avoid matching any character instead of a literal period.
There was a problem hiding this comment.
Oh...Sorry for forgetting that. Updated.
1e4ab50 to
ffbd3a3
Compare
lib/internal/errors.js
Outdated
There was a problem hiding this comment.
maybe "was used before" or "was already used" ?
There was a problem hiding this comment.
@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.
ffbd3a3 to
a907059
Compare
|
Thanks. Landed in b5eccc4 |
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>
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>
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>
|
Doesn't land on v6.x afaict. If it does land somewhere else in the tree lmk |
Add duplicate error symbol checking in
E()to avoid potential confusing result.Improve coverage of
internal/errors.js.Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
errors