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 <[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]>
  • Loading branch information
cjihrig authored and ZYSzys committed Jun 16, 2019
1 parent 2b7dfbc commit 2b8b230
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 2b8b230

Please sign in to comment.