(srv, query, file, expr)
| 922 | } |
| 923 | |
| 924 | function findTypeAtExpr(srv, query, file, expr) { |
| 925 | var exprName, exprType; |
| 926 | var type = findExprType(srv, query, file, expr), exprType = type; |
| 927 | if (query.preferFunction) |
| 928 | type = type.getFunctionType() || type.getType(); |
| 929 | else |
| 930 | type = type.getType(); |
| 931 | |
| 932 | if (expr) { |
| 933 | if (expr.node.type == "Identifier") |
| 934 | exprName = expr.node.name; |
| 935 | else if (expr.node.type == "MemberExpression" && !expr.node.computed) |
| 936 | exprName = expr.node.property.name; |
| 937 | else if (expr.node.type == "MethodDefinition" && !expr.node.computed) |
| 938 | exprName = expr.node.key.name; |
| 939 | } |
| 940 | |
| 941 | if (query.depth != null && typeof query.depth != "number") |
| 942 | throw ternError(".query.depth must be a number"); |
| 943 | |
| 944 | return [type, exprName, exprType]; |
| 945 | } |
| 946 | |
| 947 | function findTypeAt(srv, query, file) { |
| 948 | var type, exprName, exprType; |
no test coverage detected
searching dependent graphs…