MCPcopy
hub / github.com/ternjs/tern / charDistanceBetween

Function charDistanceBetween

lib/tern.js:613–620  ·  view source on GitHub ↗
(file, start, end)

Source from the content-addressed store, hash-verified

611 };
612
613 function charDistanceBetween(file, start, end) {
614 var diff = end - start, m;
615 if (file.hasAstral) {
616 astral.lastIndex = start;
617 while ((m = astral.exec(file.text)) && m.index < end) diff--;
618 }
619 return diff;
620 }
621
622 function asLineChar(file, pos) {
623 if (!file) return {line: 0, ch: 0};

Callers 2

asLineCharFunction · 0.85
tern.jsFile · 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…