MCPcopy Index your code
hub / github.com/nodejs/node / getLineForScriptOffset

Method getLineForScriptOffset

deps/v8/tools/profview/profview.js:1576–1584  ·  view source on GitHub ↗
(script, scriptOffset)

Source from the content-addressed store, hash-verified

1574 }
1575
1576 getLineForScriptOffset(script, scriptOffset) {
1577 let line = 0;
1578 let charsConsumed = 0;
1579 for (; line < script.length; ++line) {
1580 charsConsumed += script[line].length + 1; // Add 1 for newline.
1581 if (charsConsumed > scriptOffset) break;
1582 }
1583 return line;
1584 }
1585
1586 hasSource(functionId) {
1587 return this.functions.has(functionId);

Callers 1

generateSourceViewMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected