]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore(shared): remove extra NaN logic (#3837)
authorHomyee King <HomyeeKing@gmail.com>
Mon, 19 Jul 2021 21:22:21 +0000 (05:22 +0800)
committerGitHub <noreply@github.com>
Mon, 19 Jul 2021 21:22:21 +0000 (17:22 -0400)
packages/shared/src/index.ts

index 84b324beda3511e50f9e764a460e1b75fff0e30c..3c000005ec883a11af88a98aae205dbd052d4e90 100644 (file)
@@ -143,7 +143,7 @@ export const toHandlerKey = cacheStringFunction(
 
 // compare whether a value has changed, accounting for NaN.
 export const hasChanged = (value: any, oldValue: any): boolean =>
-  value !== oldValue && (value === value || oldValue === oldValue)
+  !Object.is(value, oldValue)
 
 export const invokeArrayFns = (fns: Function[], arg?: any) => {
   for (let i = 0; i < fns.length; i++) {