lint: Changeset no var

pull/4832/head^2
John McLear 2021-02-17 16:15:36 +00:00
parent 0b78ad2f90
commit 3b5b996d84
1 changed files with 7 additions and 7 deletions

View File

@ -612,7 +612,7 @@ exports.textLinesMutator = (lines) => {
const isCurLineInSplice = () => (curLine - curSplice[0] < (curSplice.length - 2)); const isCurLineInSplice = () => (curLine - curSplice[0] < (curSplice.length - 2));
const debugPrint = (typ) => { const debugPrint = (typ) => { /* eslint-disable-line no-unused-vars */
print(`${typ}: ${curSplice.toSource()} / ${curLine},${curCol} / ${lines_toSource()}`); print(`${typ}: ${curSplice.toSource()} / ${curLine},${curCol} / ${lines_toSource()}`);
}; };
@ -745,7 +745,7 @@ exports.textLinesMutator = (lines) => {
// curLine += newLines.length; // curLine += newLines.length;
// } // }
// else { // else {
var sline = curSplice.length - 1; const sline = curSplice.length - 1;
const theLine = curSplice[sline]; const theLine = curSplice[sline];
const lineCol = curCol; const lineCol = curCol;
curSplice[sline] = theLine.substring(0, lineCol) + newLines[0]; curSplice[sline] = theLine.substring(0, lineCol) + newLines[0];
@ -761,7 +761,7 @@ exports.textLinesMutator = (lines) => {
curLine += newLines.length; curLine += newLines.length;
} }
} else { } else {
var sline = putCurLineInSplice(); const sline = putCurLineInSplice();
if (!curSplice[sline]) { if (!curSplice[sline]) {
console.error('curSplice[sline] not populated, actual curSplice contents is ', curSplice, '. Possibly related to https://github.com/ether/etherpad-lite/issues/2802'); console.error('curSplice[sline] not populated, actual curSplice contents is ', curSplice, '. Possibly related to https://github.com/ether/etherpad-lite/issues/2802');
} }
@ -1716,7 +1716,7 @@ exports.builder = (oldLen) => {
const o = exports.newOp(); const o = exports.newOp();
const charBank = exports.stringAssembler(); const charBank = exports.stringAssembler();
var self = { const self = {
// attribs are [[key1,value1],[key2,value2],...] or '*0*1...' (no pool needed in latter case) // attribs are [[key1,value1],[key2,value2],...] or '*0*1...' (no pool needed in latter case)
keep: (N, L, attribs, pool) => { keep: (N, L, attribs, pool) => {
o.opcode = '='; o.opcode = '=';
@ -1949,7 +1949,7 @@ exports.inverse = (cs, lines, alines, pool) => {
attribKeys.push(pool.getAttribKey(n)); attribKeys.push(pool.getAttribKey(n));
attribValues.push(pool.getAttribValue(n)); attribValues.push(pool.getAttribValue(n));
}); });
var undoBackToAttribs = cachedStrFunc((attribs) => { const undoBackToAttribs = cachedStrFunc((attribs) => {
const backAttribs = []; const backAttribs = [];
for (let i = 0; i < attribKeys.length; i++) { for (let i = 0; i < attribKeys.length; i++) {
const appliedKey = attribKeys[i]; const appliedKey = attribKeys[i];
@ -1971,8 +1971,8 @@ exports.inverse = (cs, lines, alines, pool) => {
} else if (csOp.opcode === '+') { } else if (csOp.opcode === '+') {
builder.remove(csOp.chars, csOp.lines); builder.remove(csOp.chars, csOp.lines);
} else if (csOp.opcode === '-') { } else if (csOp.opcode === '-') {
var textBank = nextText(csOp.chars); const textBank = nextText(csOp.chars);
var textBankIndex = 0; let textBankIndex = 0;
consumeAttribRuns(csOp.chars, (len, attribs, endsLine) => { consumeAttribRuns(csOp.chars, (len, attribs, endsLine) => {
builder.insert(textBank.substr(textBankIndex, len), attribs); builder.insert(textBank.substr(textBankIndex, len), attribs);
textBankIndex += len; textBankIndex += len;