mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
perf_hooks,trace_events: use stricter equality
There is no need to use loose equality on these checks because undefined is caught by the preceding typeof check. PR-URL: https://github.com/nodejs/node/pull/28166 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
This commit is contained in:
parent
2b7dfbcdbe
commit
2b8b23067d
@ -332,7 +332,7 @@ class PerformanceObserver extends AsyncResource {
|
||||
}
|
||||
|
||||
observe(options) {
|
||||
if (typeof options !== 'object' || options == null) {
|
||||
if (typeof options !== 'object' || options === null) {
|
||||
throw new ERR_INVALID_ARG_TYPE('options', 'Object', options);
|
||||
}
|
||||
if (!Array.isArray(options.entryTypes)) {
|
||||
|
@ -73,7 +73,7 @@ class Tracing {
|
||||
}
|
||||
|
||||
function createTracing(options) {
|
||||
if (typeof options !== 'object' || options == null)
|
||||
if (typeof options !== 'object' || options === null)
|
||||
throw new ERR_INVALID_ARG_TYPE('options', 'object', options);
|
||||
|
||||
if (!Array.isArray(options.categories)) {
|
||||
|
Loading…
Reference in New Issue
Block a user