File tree Expand file tree Collapse file tree 1 file changed +13
-14
lines changed
packages/compiler-sfc/src/script Expand file tree Collapse file tree 1 file changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -1235,26 +1235,25 @@ export function inferRuntimeType(
12351235 try {
12361236 const types = resolveIndexType ( ctx , node , scope )
12371237 return flattenTypes ( ctx , types , scope )
1238- } catch ( e ) {
1239- // avoid hard error, fallback to unknown
1240- return [ UNKNOWN_TYPE ]
1241- }
1238+ } catch ( e ) { }
12421239 }
12431240
12441241 case 'ClassDeclaration' :
12451242 return [ 'Object' ]
12461243
12471244 case 'TSImportType' : {
1248- const sourceScope = importSourceToScope (
1249- ctx ,
1250- node . argument ,
1251- scope ,
1252- node . argument . value
1253- )
1254- const resolved = resolveTypeReference ( ctx , node , sourceScope )
1255- if ( resolved ) {
1256- return inferRuntimeType ( ctx , resolved , resolved . _ownerScope )
1257- }
1245+ try {
1246+ const sourceScope = importSourceToScope (
1247+ ctx ,
1248+ node . argument ,
1249+ scope ,
1250+ node . argument . value
1251+ )
1252+ const resolved = resolveTypeReference ( ctx , node , sourceScope )
1253+ if ( resolved ) {
1254+ return inferRuntimeType ( ctx , resolved , resolved . _ownerScope )
1255+ }
1256+ } catch ( e ) { }
12581257 }
12591258
12601259 default :
You can’t perform that action at this time.
0 commit comments