@@ -3928,6 +3928,10 @@ function writeStyleResourceAttributeInJS(
3928
3928
// Attribute renames
3929
3929
case 'className ':
3930
3930
attributeName = 'class ';
3931
+ if ( __DEV__ ) {
3932
+ checkAttributeStringCoercion ( value , attributeName ) ;
3933
+ }
3934
+ attributeValue = '' + ( value : any ) ;
3931
3935
break ;
3932
3936
3933
3937
// Booleans
@@ -3941,33 +3945,32 @@ function writeStyleResourceAttributeInJS(
3941
3945
// Santized URLs
3942
3946
case 'src ':
3943
3947
case 'href ': {
3948
+ value = sanitizeURL ( value ) ;
3944
3949
if ( __DEV__ ) {
3945
3950
checkAttributeStringCoercion ( value , attributeName ) ;
3946
3951
}
3947
- value = sanitizeURL ( value ) ;
3952
+ attributeValue = '' + ( value : any ) ;
3948
3953
break ;
3949
3954
}
3950
3955
default : {
3956
+ if (
3957
+ // shouldIgnoreAttribute
3958
+ // We have already filtered out null/undefined and reserved words.
3959
+ name . length > 2 &&
3960
+ ( name [ 0 ] === 'o' || name [ 0 ] === 'O' ) &&
3961
+ ( name [ 1 ] === 'n' || name [ 1 ] === 'N' )
3962
+ ) {
3963
+ return ;
3964
+ }
3951
3965
if ( ! isAttributeNameSafe ( name ) ) {
3952
3966
return ;
3953
3967
}
3968
+ if ( __DEV__ ) {
3969
+ checkAttributeStringCoercion ( value , attributeName ) ;
3970
+ }
3971
+ attributeValue = '' + ( value : any ) ;
3954
3972
}
3955
3973
}
3956
-
3957
- if (
3958
- // shouldIgnoreAttribute
3959
- // We have already filtered out null/undefined and reserved words.
3960
- name . length > 2 &&
3961
- ( name [ 0 ] === 'o' || name [ 0 ] === 'O' ) &&
3962
- ( name [ 1 ] === 'n' || name [ 1 ] === 'N' )
3963
- ) {
3964
- return ;
3965
- }
3966
-
3967
- if ( __DEV__ ) {
3968
- checkAttributeStringCoercion ( value , attributeName ) ;
3969
- }
3970
- attributeValue = '' + ( value : any ) ;
3971
3974
writeChunk ( destination , arrayInterstitial ) ;
3972
3975
writeChunk (
3973
3976
destination ,
@@ -4121,6 +4124,10 @@ function writeStyleResourceAttributeInAttr(
4121
4124
// Attribute renames
4122
4125
case 'className ':
4123
4126
attributeName = 'class ';
4127
+ if ( __DEV__ ) {
4128
+ checkAttributeStringCoercion ( value , attributeName ) ;
4129
+ }
4130
+ attributeValue = '' + ( value : any ) ;
4124
4131
break ;
4125
4132
4126
4133
// Booleans
@@ -4134,33 +4141,32 @@ function writeStyleResourceAttributeInAttr(
4134
4141
// Santized URLs
4135
4142
case 'src ':
4136
4143
case 'href ': {
4144
+ value = sanitizeURL ( value ) ;
4137
4145
if ( __DEV__ ) {
4138
4146
checkAttributeStringCoercion ( value , attributeName ) ;
4139
4147
}
4140
- value = sanitizeURL ( value ) ;
4148
+ attributeValue = '' + ( value : any ) ;
4141
4149
break ;
4142
4150
}
4143
4151
default : {
4152
+ if (
4153
+ // shouldIgnoreAttribute
4154
+ // We have already filtered out null/undefined and reserved words.
4155
+ name . length > 2 &&
4156
+ ( name [ 0 ] === 'o' || name [ 0 ] === 'O' ) &&
4157
+ ( name [ 1 ] === 'n' || name [ 1 ] === 'N' )
4158
+ ) {
4159
+ return ;
4160
+ }
4144
4161
if ( ! isAttributeNameSafe ( name ) ) {
4145
4162
return ;
4146
4163
}
4164
+ if ( __DEV__ ) {
4165
+ checkAttributeStringCoercion ( value , attributeName ) ;
4166
+ }
4167
+ attributeValue = '' + ( value : any ) ;
4147
4168
}
4148
4169
}
4149
-
4150
- if (
4151
- // shouldIgnoreAttribute
4152
- // We have already filtered out null/undefined and reserved words.
4153
- name . length > 2 &&
4154
- ( name [ 0 ] === 'o' || name [ 0 ] === 'O' ) &&
4155
- ( name [ 1 ] === 'n' || name [ 1 ] === 'N' )
4156
- ) {
4157
- return ;
4158
- }
4159
-
4160
- if ( __DEV__ ) {
4161
- checkAttributeStringCoercion ( value , attributeName ) ;
4162
- }
4163
- attributeValue = '' + ( value : any ) ;
4164
4170
writeChunk ( destination , arrayInterstitial ) ;
4165
4171
writeChunk (
4166
4172
destination ,
0 commit comments