MCPcopy Create free account
hub / github.com/prototypejs/prototype / eofNL

Function eofNL

test/unit/static/js/mocha.js:253–262  ·  view source on GitHub ↗
(curRange, i, current)

Source from the content-addressed store, hash-verified

251 return lines.map(function(entry) { return ' ' + entry; });
252 }
253 function eofNL(curRange, i, current) {
254 var last = diff[diff.length-2],
255 isLast = i === diff.length-2,
256 isLastOfType = i === diff.length-3 && (current.added === !last.added || current.removed === !last.removed);
257
258 // Figure out if this is the last line for the given file and missing NL
259 if (!/\n$/.test(current.value) && (isLast || isLastOfType)) {
260 curRange.push('\\ No newline at end of file');
261 }
262 }
263
264 var oldRangeStart = 0, newRangeStart = 0, curRange = [],
265 oldLine = 1, newLine = 1;

Callers 1

mocha.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected