Skip to content

Commit

Permalink
perf_hooks,trace_events: use stricter equality
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
cjihrig authored and BridgeAR committed Jun 17, 2019
1 parent 7a4a94a commit 44b0e13
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/perf_hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion lib/trace_events.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 44b0e13

Please sign in to comment.