MCPcopy Index your code
hub / github.com/ternjs/tern / inBody

Function inBody

lib/tern.js:832–843  ·  view source on GitHub ↗
(node, pos)

Source from the content-addressed store, hash-verified

830 }
831
832 function inBody(node, pos) {
833 var body = node.body, start, end;
834 if (!body) return false;
835 if (Array.isArray(body)) {
836 start = body[0].start;
837 end = body[body.length - 1].end;
838 } else {
839 start = body.start;
840 end = body.end;
841 }
842 return start <= pos && end >= pos;
843 }
844
845 var findExpr = exports.findQueryExpr = function(file, query, wide) {
846 if (query.end == null) throw ternError("missing .query.end field");

Callers 2

tern.jsFile · 0.85
findExprAroundFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…