File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
runtime-core/src/components Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -423,7 +423,7 @@ function createSuspenseBoundary(
423423 o : { parentNode, remove }
424424 } = rendererInternals
425425
426- const timeout = toNumber ( vnode . props && vnode . props . timeout )
426+ const timeout = vnode . props ? toNumber ( vnode . props . timeout ) : undefined
427427 if ( __DEV__ ) {
428428 assertNumber ( timeout , `Suspense timeout` )
429429 }
Original file line number Diff line number Diff line change @@ -163,10 +163,11 @@ export const looseToNumber = (val: any): any => {
163163}
164164
165165/**
166+ * Only conerces number-like strings
166167 * "123-foo" will be returned as-is
167168 */
168169export const toNumber = ( val : any ) : any => {
169- const n = Number ( val )
170+ const n = isString ( val ) ? Number ( val ) : NaN
170171 return isNaN ( n ) ? val : n
171172}
172173
You can’t perform that action at this time.
0 commit comments