Skip to content

Commit b6c0500

Browse files
committed
ref: Remove Number.isNaN method usage
1 parent 2d9a0bd commit b6c0500

File tree

5 files changed

+3
-21
lines changed

5 files changed

+3
-21
lines changed

packages/browser/src/tracekit.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -918,10 +918,6 @@ TraceKit._computeStackTrace = (function _computeStackTraceWrapper() {
918918
}
919919

920920
function popFrames(stacktrace: any, popSize: number): any {
921-
if (Number.isNaN(popSize)) {
922-
return stacktrace;
923-
}
924-
925921
try {
926922
return {
927923
...stacktrace,

packages/browser/test/integration/polyfills/nan.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

packages/browser/test/integration/run.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ function build() {
7676
"polyfills/raf.js",
7777
"polyfills/events.js",
7878
"polyfills/assign.js",
79-
"polyfills/nan.js",
8079
]);
8180

8281
writeFile(

packages/core/src/dsn.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export class Dsn implements DsnComponents {
9494
throw new SentryError(ERROR_MESSAGE);
9595
}
9696

97-
if (this.port && Number.isNaN(parseInt(this.port, 10))) {
97+
if (this.port && isNaN(parseInt(this.port, 10))) {
9898
throw new SentryError(ERROR_MESSAGE);
9999
}
100100
}

packages/utils/src/object.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ function normalizeValue<T>(value: T, key?: any): T | string {
181181
return '[SyntheticEvent]';
182182
}
183183

184-
if (Number.isNaN((value as unknown) as number)) {
184+
// tslint:disable-next-line:no-tautology-expression
185+
if (typeof value === 'number' && value !== value) {
185186
return '[NaN]';
186187
}
187188

0 commit comments

Comments
 (0)