-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error alphabetization fixes #15307
Error alphabetization fixes #15307
Conversation
Was just looking at this too. I think, ideally, the doc at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
We should likely swap the order of these two commits to avoid having a commit with a broken test suite... this would break |
Also fixes error being (now!) properly thrown by alphabetize-errors.
Was not using proper magic comment syntax before!
6bfcfaf
to
f3f2373
Compare
@MylesBorins swapped commit order |
E('ERR_V8BREAKITERATOR', 'Full ICU data not installed. ' + | ||
'See https://github.com/nodejs/node/wiki/Intl'); | ||
E('ERR_VALID_PERFORMANCE_ENTRY_TYPE', | ||
'At least one valid performance entry type is required'); | ||
E('ERR_VALUE_OUT_OF_RANGE', 'The value of "%s" must be %s. Received "%s"'); | ||
E('ERR_VALUE_OUT_OF_RANGE', (start, end, value) => { | ||
return `The value of "${start}" must be ${end}. Received "${value}"`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable names are misleading. The first parameter is the name of the value and the second is a description of the set of permitted values, so they don't actually depict a [start, end]
range. Could you change the names while you are at it?
@maclover7 this needs a rebase. |
Rebased on landing. |
Also fixes error being (now!) properly thrown by alphabetize-errors. also properly enable lint rule Was not using proper magic comment syntax before! -URL: #15307 Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Landed in e9358af |
Also fixes error being (now!) properly thrown by alphabetize-errors. also properly enable lint rule Was not using proper magic comment syntax before! -URL: nodejs/node#15307 Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This would need to be backported for v8.x |
Also fixes error being (now!) properly thrown by alphabetize-errors. also properly enable lint rule Was not using proper magic comment syntax before! -URL: nodejs/node#15307 Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Also fixes error being (now!) properly thrown by alphabetize-errors. also properly enable lint rule Was not using proper magic comment syntax before! -URL: #15307 Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Also fixes error being (now!) properly thrown by alphabetize-errors. also properly enable lint rule Was not using proper magic comment syntax before! -URL: #15307 Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
A few things going on here:
alphabetize-errors
lint rule (thank you @MylesBorins for pointing this out via Alphabatize errors lint rule does not appear to work #15305!)lib/internal/errors.js
, by removing a duplicate error definition (two for one special, I guess!)Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
errors, test