Skip to content

Commit 44b0e13

Browse files
cjihrigBridgeAR
authored andcommitted
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: #28166 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]>
1 parent 7a4a94a commit 44b0e13

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/perf_hooks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ class PerformanceObserver extends AsyncResource {
332332
}
333333

334334
observe(options) {
335-
if (typeof options !== 'object' || options == null) {
335+
if (typeof options !== 'object' || options === null) {
336336
throw new ERR_INVALID_ARG_TYPE('options', 'Object', options);
337337
}
338338
if (!Array.isArray(options.entryTypes)) {

lib/trace_events.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class Tracing {
7373
}
7474

7575
function createTracing(options) {
76-
if (typeof options !== 'object' || options == null)
76+
if (typeof options !== 'object' || options === null)
7777
throw new ERR_INVALID_ARG_TYPE('options', 'object', options);
7878

7979
if (!Array.isArray(options.categories)) {

0 commit comments

Comments
 (0)