(arg, checker)
| 144856 | } |
| 144857 | // should be kept up to date with getTransformationBody in convertToAsyncFunction.ts |
| 144858 | function isFixablePromiseArgument(arg, checker) { |
| 144859 | switch (arg.kind) { |
| 144860 | case 256 /* SyntaxKind.FunctionDeclaration */: |
| 144861 | case 213 /* SyntaxKind.FunctionExpression */: |
| 144862 | var functionFlags = ts.getFunctionFlags(arg); |
| 144863 | if (functionFlags & 1 /* FunctionFlags.Generator */) { |
| 144864 | return false; |
| 144865 | } |
| 144866 | // falls through |
| 144867 | case 214 /* SyntaxKind.ArrowFunction */: |
| 144868 | visitedNestedConvertibleFunctions.set(getKeyFromNode(arg), true); |
| 144869 | // falls through |
| 144870 | case 104 /* SyntaxKind.NullKeyword */: |
| 144871 | return true; |
| 144872 | case 79 /* SyntaxKind.Identifier */: |
| 144873 | case 206 /* SyntaxKind.PropertyAccessExpression */: { |
| 144874 | var symbol = checker.getSymbolAtLocation(arg); |
| 144875 | if (!symbol) { |
| 144876 | return false; |
| 144877 | } |
| 144878 | return checker.isUndefinedSymbol(symbol) || |
| 144879 | ts.some(ts.skipAlias(symbol, checker).declarations, function (d) { return ts.isFunctionLike(d) || ts.hasInitializer(d) && !!d.initializer && ts.isFunctionLike(d.initializer); }); |
| 144880 | } |
| 144881 | default: |
| 144882 | return false; |
| 144883 | } |
| 144884 | } |
| 144885 | function getKeyFromNode(exp) { |
| 144886 | return "".concat(exp.pos.toString(), ":").concat(exp.end.toString()); |
| 144887 | } |
no test coverage detected