Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 44b0e13

Browse filesBrowse 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 <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 7a4a94a commit 44b0e13
Copy full SHA for 44b0e13

File tree

Expand file treeCollapse file tree

2 files changed

+2
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+2
-2
lines changed
Open diff view settings
Collapse file

‎lib/perf_hooks.js‎

Copy file name to clipboardExpand all lines: lib/perf_hooks.js
+1-1Lines 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)) {
Collapse file

‎lib/trace_events.js‎

Copy file name to clipboardExpand all lines: lib/trace_events.js
+1-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.