@@ -14,9 +14,9 @@ import {
14
14
} from 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface' ;
15
15
import isArray from 'shared/isArray' ;
16
16
17
- import { enableShallowPropDiffing } from 'shared/ReactFeatureFlags' ;
17
+ import { enableShallowPropDiffing } from 'shared/ReactFeatureFlags' ;
18
18
19
- import type { AttributeConfiguration } from './ReactNativeTypes' ;
19
+ import type { AttributeConfiguration } from './ReactNativeTypes' ;
20
20
21
21
const emptyObject = { } ;
22
22
@@ -32,7 +32,7 @@ const emptyObject = {};
32
32
type NestedNode = Array < NestedNode > | Object ;
33
33
34
34
// Tracks removed keys
35
- let removedKeys : { [ string ] : boolean } | null = null ;
35
+ let removedKeys : { [ string ] : boolean } | null = null ;
36
36
let removedKeyCount = 0 ;
37
37
38
38
const deepDifferOptions = {
@@ -344,7 +344,7 @@ function diffProperties(
344
344
// case: !Object is the default case
345
345
if ( enableShallowPropDiffing || defaultDiffer ( prevProp , nextProp ) ) {
346
346
// a normal leaf has changed
347
- ( updatePayload || ( updatePayload = ( { } : { [ string ] : $FlowFixMe } ) ) ) [
347
+ ( updatePayload || ( updatePayload = ( { } : { [ string ] : $FlowFixMe } ) ) ) [
348
348
propKey
349
349
] = nextProp ;
350
350
}
@@ -363,9 +363,9 @@ function diffProperties(
363
363
const nextValue =
364
364
typeof attributeConfig . process === 'function'
365
365
? // $FlowFixMe[incompatible-use] found when upgrading Flow
366
- attributeConfig . process ( nextProp )
366
+ attributeConfig . process ( nextProp )
367
367
: nextProp ;
368
- ( updatePayload || ( updatePayload = ( { } : { [ string ] : $FlowFixMe } ) ) ) [
368
+ ( updatePayload || ( updatePayload = ( { } : { [ string ] : $FlowFixMe } ) ) ) [
369
369
propKey
370
370
] = nextValue ;
371
371
}
@@ -421,11 +421,11 @@ function diffProperties(
421
421
) {
422
422
// case: CustomAttributeConfiguration | !Object
423
423
// Flag the leaf property for removal by sending a sentinel.
424
- ( updatePayload || ( updatePayload = ( { } : { [ string ] : $FlowFixMe } ) ) ) [
424
+ ( updatePayload || ( updatePayload = ( { } : { [ string ] : $FlowFixMe } ) ) ) [
425
425
propKey
426
426
] = null ;
427
427
if ( ! removedKeys ) {
428
- removedKeys = ( { } : { [ string ] : boolean } ) ;
428
+ removedKeys = ( { } : { [ string ] : boolean } ) ;
429
429
}
430
430
if ( ! removedKeys [ propKey ] ) {
431
431
removedKeys [ propKey ] = true ;
@@ -478,7 +478,7 @@ function fastAddProperties(
478
478
} else {
479
479
continue ;
480
480
}
481
- } else if ( typeof attributeConfig . process === 'function' ) {
481
+ } else if ( typeof attributeConfig === 'object' && typeof attributeConfig . process === 'function' ) {
482
482
// An atomic prop with custom processing.
483
483
newValue = attributeConfig . process ( prop ) ;
484
484
} else if ( typeof prop === 'function' ) {
@@ -494,7 +494,7 @@ function fastAddProperties(
494
494
495
495
if ( newValue !== undefined ) {
496
496
if ( ! payload ) {
497
- payload = ( { } : { [ string ] : $FlowFixMe } ) ;
497
+ payload = ( { } : { [ string ] : $FlowFixMe } ) ;
498
498
}
499
499
payload [ propKey ] = newValue ;
500
500
continue ;
0 commit comments