(context: TransformationContext, type: ts.Type)
| 189 | ]); |
| 190 | |
| 191 | export function checkForLuaLibType(context: TransformationContext, type: ts.Type): void { |
| 192 | const symbol = type.symbol; |
| 193 | if (!symbol || symbol.parent) return; |
| 194 | const name = symbol.name; |
| 195 | |
| 196 | switch (name) { |
| 197 | case "Map": |
| 198 | case "MapConstructor": |
| 199 | importLuaLibFeature(context, LuaLibFeature.Map); |
| 200 | return; |
| 201 | case "Set": |
| 202 | case "SetConstructor": |
| 203 | importLuaLibFeature(context, LuaLibFeature.Set); |
| 204 | return; |
| 205 | case "WeakMap": |
| 206 | case "WeakMapConstructor": |
| 207 | importLuaLibFeature(context, LuaLibFeature.WeakMap); |
| 208 | return; |
| 209 | case "WeakSet": |
| 210 | case "WeakSetConstructor": |
| 211 | importLuaLibFeature(context, LuaLibFeature.WeakSet); |
| 212 | return; |
| 213 | case "Promise": |
| 214 | case "PromiseConstructor": |
| 215 | importLuaLibFeature(context, LuaLibFeature.Promise); |
| 216 | return; |
| 217 | } |
| 218 | |
| 219 | if (builtinErrorTypeNames.has(name)) { |
| 220 | importLuaLibFeature(context, LuaLibFeature.Error); |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | export function tryGetStandardLibrarySymbolOfType( |
| 225 | context: TransformationContext, |
no test coverage detected