Skip to content

Commit 6ab3fb5

Browse files
use Object.is() for equality check
1 parent 60c98b8 commit 6ab3fb5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

modules/Data.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ export class Data {
2323
let a = this[key];
2424
let b = other[key];
2525
if (
26-
a !== b &&
26+
!Object.is(a, b) &&
2727
(a == null ||
2828
b == null ||
29-
(a instanceof Data && b instanceof Data ? !a.equals(b) : a.valueOf() !== b.valueOf()))
29+
(a instanceof Data && b instanceof Data
30+
? !a.equals(b)
31+
: !Object.is(a.valueOf(), b.valueOf())))
3032
)
3133
return false;
3234
}

0 commit comments

Comments
 (0)