@@ -1288,20 +1288,39 @@ function propsDiffer(src: Record<string, any>, dst: Record<string, any>): boolea
1288
1288
if ( srcEmpty || dstEmpty ) {
1289
1289
return true ;
1290
1290
}
1291
- let srcKeys = removePropsKeys ( Object . keys ( src ) , [ 'children' , QBackRefs ] ) ;
1292
- let dstKeys = removePropsKeys ( Object . keys ( dst ) , [ 'children' , QBackRefs ] ) ;
1293
- if ( srcKeys . length !== dstKeys . length ) {
1291
+
1292
+ const srcKeys = Object . keys ( src ) ;
1293
+ const dstKeys = Object . keys ( dst ) ;
1294
+
1295
+ let srcLen = srcKeys . length ;
1296
+ let dstLen = dstKeys . length ;
1297
+
1298
+ if ( 'children' in src ) {
1299
+ srcLen -- ;
1300
+ }
1301
+ if ( QBackRefs in src ) {
1302
+ srcLen -- ;
1303
+ }
1304
+ if ( 'children' in dst ) {
1305
+ dstLen -- ;
1306
+ }
1307
+ if ( QBackRefs in dst ) {
1308
+ dstLen -- ;
1309
+ }
1310
+
1311
+ if ( srcLen !== dstLen ) {
1294
1312
return true ;
1295
1313
}
1296
- srcKeys = srcKeys . sort ( ) ;
1297
- dstKeys = dstKeys . sort ( ) ;
1298
- for ( let idx = 0 ; idx < srcKeys . length ; idx ++ ) {
1299
- const srcKey = srcKeys [ idx ] ;
1300
- const dstKey = dstKeys [ idx ] ;
1301
- if ( srcKey !== dstKey || src [ srcKey ] !== dst [ dstKey ] ) {
1314
+
1315
+ for ( const key of srcKeys ) {
1316
+ if ( key === 'children' || key === QBackRefs ) {
1317
+ continue ;
1318
+ }
1319
+ if ( ! Object . prototype . hasOwnProperty . call ( dst , key ) || src [ key ] !== dst [ key ] ) {
1302
1320
return true ;
1303
1321
}
1304
1322
}
1323
+
1305
1324
return false ;
1306
1325
}
1307
1326
@@ -1312,18 +1331,6 @@ function isPropsEmpty(props: Record<string, any>): boolean {
1312
1331
return Object . keys ( props ) . length === 0 ;
1313
1332
}
1314
1333
1315
- function removePropsKeys ( keys : string [ ] , propKeys : string [ ] ) : string [ ] {
1316
- for ( let i = propKeys . length - 1 ; i >= 0 ; i -- ) {
1317
- const propKey = propKeys [ i ] ;
1318
- const propIdx = keys . indexOf ( propKey ) ;
1319
- if ( propIdx !== - 1 ) {
1320
- keys . splice ( propIdx , 1 ) ;
1321
- }
1322
- }
1323
-
1324
- return keys ;
1325
- }
1326
-
1327
1334
/**
1328
1335
* If vnode is removed, it is necessary to release all subscriptions associated with it.
1329
1336
*
0 commit comments