@@ -5503,7 +5503,8 @@ export class LuaTransformer {
55035503
55045504 protected checkForLuaLibType ( type : ts . Type ) : void {
55055505 if ( type . symbol ) {
5506- switch ( this . checker . getFullyQualifiedName ( type . symbol ) ) {
5506+ const name = this . checker . getFullyQualifiedName ( type . symbol ) ;
5507+ switch ( name ) {
55075508 case "Map" :
55085509 this . importLuaLibFeature ( LuaLibFeature . Map ) ;
55095510 return ;
@@ -5516,42 +5517,9 @@ export class LuaTransformer {
55165517 case "WeakSet" :
55175518 this . importLuaLibFeature ( LuaLibFeature . WeakSet ) ;
55185519 return ;
5519- case "Error" :
5520- this . importLuaLibFeature ( LuaLibFeature . Error ) ;
5521- return ;
5522- case "ErrorConstructor" :
5523- this . importLuaLibFeature ( LuaLibFeature . Error ) ;
5524- return ;
5525- case "RangeError" :
5526- this . importLuaLibFeature ( LuaLibFeature . Error ) ;
5527- return ;
5528- case "RangeErrorConstructor" :
5529- this . importLuaLibFeature ( LuaLibFeature . Error ) ;
5530- return ;
5531- case "ReferenceError" :
5532- this . importLuaLibFeature ( LuaLibFeature . Error ) ;
5533- return ;
5534- case "ReferenceErrorConstructor" :
5535- this . importLuaLibFeature ( LuaLibFeature . Error ) ;
5536- return ;
5537- case "SyntaxError" :
5538- this . importLuaLibFeature ( LuaLibFeature . Error ) ;
5539- return ;
5540- case "SyntaxErrorConstructor" :
5541- this . importLuaLibFeature ( LuaLibFeature . Error ) ;
5542- return ;
5543- case "TypeError" :
5544- this . importLuaLibFeature ( LuaLibFeature . Error ) ;
5545- return ;
5546- case "TypeErrorConstructor" :
5547- this . importLuaLibFeature ( LuaLibFeature . Error ) ;
5548- return ;
5549- case "URIError" :
5550- this . importLuaLibFeature ( LuaLibFeature . Error ) ;
5551- return ;
5552- case "URIErrorConstructor" :
5553- this . importLuaLibFeature ( LuaLibFeature . Error ) ;
5554- return ;
5520+ }
5521+ if ( tsHelper . isBuiltInErrorTypeName ( name ) ) {
5522+ this . importLuaLibFeature ( LuaLibFeature . Error ) ;
55555523 }
55565524 }
55575525 }
0 commit comments