| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
ping @nodejs/tsc |
Sorry, something went wrong.
There was a problem hiding this comment.
Left a few nits. LGTM if CI is green.
Sorry, something went wrong.
There was a problem hiding this comment.
Would be nice to link this to the documentation of EventEmitter.defaultMaxListeners
Sorry, something went wrong.
There was a problem hiding this comment.
s/Function/function/? Most of the ERR_INVALID_ARG_TYPEs in the code base are using lowercased types.
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
Our docs mainly use Function but it is going to print type Function and this is somewhat inconsistent out of my perspective. I think we should stick to the lower cased version.
Sorry, something went wrong.
There was a problem hiding this comment.
Do you know where the circular reference is coming from? If so - is there any possibility in untying that?
I personally also prefer using a simple if a lot over the function version. It is still a minor overhead of using the function while there is no faster check than a simple if to undefined.
Sorry, something went wrong.
There was a problem hiding this comment.
It's not a circular reference that is the concern. The events module is one of the very first modules loaded in core (because it is needed by process) and as such needs to be loaded before anything else is loaded.
Sorry, something went wrong.
There was a problem hiding this comment.
I do not really see the point for this new error type. I it extremely specific and the type name is somewhat confusing for me. I would expect it to describe having e.g. to many listeners. Using a more generic one that is similar to the old error message seems more appropriate to me.
Sorry, something went wrong.
There was a problem hiding this comment.
The challenge is that none of the existing error codes quite fit this pattern (e.g. it's a setter and not an argument or an option).
Sorry, something went wrong.
There was a problem hiding this comment.
Do we have to make this specific to the events? I would rather have this in case any unhandled error is thrown / emitted what ever.
Sorry, something went wrong.
There was a problem hiding this comment.
This is really the only place that we raise such errors that I can find.
Sorry, something went wrong.
There was a problem hiding this comment.
That is correct for the current situation but for me it is more about trying to be open for future uses.
Sorry, something went wrong.
There was a problem hiding this comment.
Using if (err !== undefined) would be better as there might be other falsy values out there that someone throws.
Sorry, something went wrong.
There was a problem hiding this comment.
This is a really confusing error message. I think we have a more appropriate error message for things like that.
Sorry, something went wrong.
There was a problem hiding this comment.
The obsolete error code should be removed. LGTM otherwise (I do not feel that strongly about the more generic name even if I would still prefer it without "EVENTS").
Sorry, something went wrong.
There was a problem hiding this comment.
That is correct for the current situation but for me it is more about trying to be open for future uses.
Sorry, something went wrong.
There was a problem hiding this comment.
This type is not used anymore and should be removed.
Sorry, something went wrong.
There was a problem hiding this comment.
oh right... heh, forgot about that ;-)
Sorry, something went wrong.
|
@BridgeAR .. updated. |
Sorry, something went wrong.
There was a problem hiding this comment.
This change looks good, but I think we need to add a test for the new error in test/parallel/test-internal-errors.js
Sorry, something went wrong.
There was a problem hiding this comment.
Why do we need to lazily load this? Is this the pattern used everywhere? Should we?
Sorry, something went wrong.
There was a problem hiding this comment.
It is because events.js is loaded before all the other modules in the dependency tree (because of bootstrapping process. Lazy loading errors prevents errors from being loaded before events is loaded.
Sorry, something went wrong.
There was a problem hiding this comment.
I would still rather inline this instead of using the function form but it should not be a blocker.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
|
@BridgeAR are you ok with the change? Can we land? |
Sorry, something went wrong.
Sorry, something went wrong.
|
Would be better if we can specify the range with ERR_OUT_OF_RANGE, that can be done later in another PR. |
Sorry, something went wrong.
There was a problem hiding this comment.
The message looks somewhat weird here because of the dot before the brackets.
I think it would be fine to either remove the dot or to move it to the end of the string.
Sorry, something went wrong.
There was a problem hiding this comment.
I would still rather inline this instead of using the function form but it should not be a blocker.
Sorry, something went wrong.
PR-URL: #15623 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
PR-URL: nodejs/node#15623 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
| Back | FazBrowse Home | New Git URL |
Migrate events.js to internal errors
Checklist
Affected core subsystem(s)
events,errors