Skip to content

Commit 2b8b230

Browse files
cjihrigZYSzys
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 <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>
1 parent 2b7dfbc commit 2b8b230

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)