File tree 2 files changed +3
-2
lines changed
runtime-core/src/components
2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -423,7 +423,7 @@ function createSuspenseBoundary(
423
423
o : { parentNode, remove }
424
424
} = rendererInternals
425
425
426
- const timeout = toNumber ( vnode . props && vnode . props . timeout )
426
+ const timeout = vnode . props ? toNumber ( vnode . props . timeout ) : undefined
427
427
if ( __DEV__ ) {
428
428
assertNumber ( timeout , `Suspense timeout` )
429
429
}
Original file line number Diff line number Diff line change @@ -163,10 +163,11 @@ export const looseToNumber = (val: any): any => {
163
163
}
164
164
165
165
/**
166
+ * Only conerces number-like strings
166
167
* "123-foo" will be returned as-is
167
168
*/
168
169
export const toNumber = ( val : any ) : any => {
169
- const n = Number ( val )
170
+ const n = isString ( val ) ? Number ( val ) : NaN
170
171
return isNaN ( n ) ? val : n
171
172
}
172
173
You can’t perform that action at this time.
0 commit comments