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

Function readline

lib/internal/v8_prof_polyfill.js:115–136  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

113}
114
115function readline() {
116 while (true) {
117 const lineBreak = line.indexOf('\n');
118 if (lineBreak !== -1) {
119 const res = line.slice(0, lineBreak);
120 line = line.slice(lineBreak + 1);
121 return res;
122 }
123 const bytes = fs.readSync(fd, buf, 0, buf.length);
124 line += dec.write(buf.slice(0, bytes));
125 if (line.length === 0) {
126 return '';
127 }
128 if (bytes === 0) {
129 process.emitWarning(`Profile file ${logFile} is broken`, {
130 code: 'BROKEN_PROFILE_FILE',
131 detail: `${JSON.stringify(line)} at the file end is broken`,
132 });
133 return '';
134 }
135 }
136}
137
138function versionCheck(firstLine, expected) {
139 // v8-version looks like

Callers 15

peeklineFunction · 0.85
processLogFileMethod · 0.85
processLogFileMethod · 0.85
processLogFileMethod · 0.85
processLogFileMethod · 0.85
box2d.jsFile · 0.85
copy.jsFile · 0.85
zlib.jsFile · 0.85
lua_binarytrees.jsFile · 0.85
fannkuch.jsFile · 0.85
primes.jsFile · 0.85
memops.jsFile · 0.85

Calls 4

sliceMethod · 0.65
indexOfMethod · 0.45
readSyncMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…