diff --git a/docs/Commands.js b/docs/Commands.js index ff21d4b..5d9ae19 100644 --- a/docs/Commands.js +++ b/docs/Commands.js @@ -940,7 +940,7 @@ function commandDRAW(args) { const wx = sx >= dx ? sx - dx : dx - sx, wy = sy >= dy ? sy - dy : dy - sy; const xmode = wx >= wy; let x = sx, y = sy, gosa = 0; - while (x != dx || y != dy) { + while (x !== dx || y !== dy) { drawPoint(x, y); if (xmode) { if (sx < dx) x++; else x--; diff --git a/docs/Compiler.js b/docs/Compiler.js index 4adcf1e..fb87f8d 100644 --- a/docs/Compiler.js +++ b/docs/Compiler.js @@ -419,20 +419,20 @@ const basicFunctions = { }; const expr7_ops = { - "OR" : function(a, b) { return a != 0 || b != 0 ? 1 : 0; }, - "||" : function(a, b) { return a != 0 || b != 0 ? 1 : 0; } + "OR" : function(a, b) { return a !== 0 || b !== 0 ? 1 : 0; }, + "||" : function(a, b) { return a !== 0 || b !== 0 ? 1 : 0; } }; const expr6_ops = { - "AND": function(a, b) { return a != 0 && b != 0 ? 1 : 0; }, - "&&" : function(a, b) { return a != 0 && b != 0 ? 1 : 0; } + "AND": function(a, b) { return a !== 0 && b !== 0 ? 1 : 0; }, + "&&" : function(a, b) { return a !== 0 && b !== 0 ? 1 : 0; } }; const expr5_ops = { - "=" : function(a, b) { return a == b ? 1 : 0; }, - "==" : function(a, b) { return a == b ? 1 : 0; }, - "<>" : function(a, b) { return a != b ? 1 : 0; }, - "!=" : function(a, b) { return a != b ? 1 : 0; }, + "=" : function(a, b) { return a === b ? 1 : 0; }, + "==" : function(a, b) { return a === b ? 1 : 0; }, + "<>" : function(a, b) { return a !== b ? 1 : 0; }, + "!=" : function(a, b) { return a !== b ? 1 : 0; }, "<" : function(a, b) { return a < b ? 1 : 0; }, ">" : function(a, b) { return a > b ? 1 : 0; }, "<=" : function(a, b) { return a <= b ? 1 : 0; }, @@ -448,15 +448,15 @@ const expr4_ops = { const expr3_ops = { "*" : function(a, b) { return arithWrap(a * b); }, "/" : function(a, b) { - if (b == 0) throw "Divide by 0"; + if (b === 0) throw "Divide by 0"; return arithWrap(a / b); }, "%" : function(a, b) { - if (b == 0) throw "Divide by 0"; + if (b === 0) throw "Divide by 0"; return arithWrap(a % b); }, "MOD": function(a, b) { - if (b == 0) throw "Divide by 0"; + if (b === 0) throw "Divide by 0"; return arithWrap(a % b); }, "<<" : function(a, b) { return (b & 0xff) >= 16 ? 0 : arithWrap(a << (b & 15)); }, @@ -468,8 +468,8 @@ const expr3_ops = { const expr2_ops = { "-" : function(a) { return arithWrap(-a); }, "~" : function(a) { return arithWrap(~a); }, - "!" : function(a) { return a == 0 ? 1 : 0; }, - "NOT": function(a) { return a == 0 ? 1 : 0; } + "!" : function(a) { return a === 0 ? 1 : 0; }, + "NOT": function(a) { return a === 0 ? 1 : 0; } }; const basicConstants = { @@ -977,7 +977,7 @@ var compiler = (function() { if (nstr.charAt(0) === "#") { nstr = nstr.substr(1); delta = 16; - } else if (nstr.charAt(0) == "`") { + } else if (nstr.charAt(0) === "`") { nstr = nstr.substr(1); delta = 2; } diff --git a/docs/Functions.js b/docs/Functions.js index 71693ca..c176163 100644 --- a/docs/Functions.js +++ b/docs/Functions.js @@ -384,7 +384,7 @@ function functionLEN(args) { let ptr = args[0]; for (;;) { const c = readVirtualMem(ptr + count); - if (c == 0 || c == 0x22) return count; + if (c === 0 || c === 0x22) return count; count++; } } diff --git a/docs/OneFiveCrowd.js b/docs/OneFiveCrowd.js index 2e6168c..69020c1 100644 --- a/docs/OneFiveCrowd.js +++ b/docs/OneFiveCrowd.js @@ -1393,7 +1393,7 @@ function keyDown(key, shiftKey, ctrlKey, altKey) { else if (0x77 <= keyCode && keyCode <= 0x7a) keyCode += 0x80 - 0x77; else if (keyCode === 0x7e) keyCode = 0x40; } - if (shiftKey && keyCode == 0x20) keyCode = 0x0e; + if (shiftKey && keyCode === 0x20) keyCode = 0x0e; keyRomanInput(keyCode); } else if (!altKey) { if (key === "Enter") { @@ -1446,7 +1446,7 @@ function keyUp(key) { else if (key === "ArrowUp") btnStatus &= ~4; else if (key === "ArrowDown") btnStatus &= ~8; else if (key === " ") btnStatus &= ~0x10; - else if (key === "x" || key == "X") btnStatus &= ~0x20; + else if (key === "x" || key === "X") btnStatus &= ~0x20; ramBytes[BTN_ADDR] = btnStatus; } @@ -1514,7 +1514,7 @@ function putChar(c, isInsert = false) { if (cursorX < 0 || SCREEN_WIDTH <= cursorX || cursorY < 0 || SCREEN_HEIGHT <= cursorY) return; switch (c) { case 0x08: // Backspace - if (cursorX > 0 || (cursorY > 0 && vramView[cursorY * SCREEN_WIDTH - 1] != 0)) { + if (cursorX > 0 || (cursorY > 0 && vramView[cursorY * SCREEN_WIDTH - 1] !== 0)) { const limit = SCREEN_HEIGHT * SCREEN_WIDTH - 1; const start = cursorY * SCREEN_WIDTH + cursorX - 1; let stop; @@ -1732,7 +1732,7 @@ function putChar(c, isInsert = false) { for (; start > 0 && vramView[start - 1] !== 0; start--); } for (; stop < limit && vramView[stop] !== 0; stop++); - if (start == stop) break; + if (start === stop) break; for (let i = start; i < stop; i++) { vramView[i] = 0; } @@ -1917,7 +1917,7 @@ function editProgram(lineno, str) { } // 必要に応じてデータを移動する let newLastPos = lastPos; - if (replaceSize != addSize) { + if (replaceSize !== addSize) { const moveSrc = replacePos + replaceSize; const moveDest = replacePos + addSize; const moveSize = lastPos - moveSrc; diff --git a/docs/VirtualMixJuice.js b/docs/VirtualMixJuice.js index 2e572eb..5ebf603 100644 --- a/docs/VirtualMixJuice.js +++ b/docs/VirtualMixJuice.js @@ -209,7 +209,7 @@ const virtualMixJuice = (function() { function rx(data, dataBps) { if (!uartConnected || dataBps !== deviceBps) return; for (let i = 0; i < data.length; i++) { - if (data[i] == 0x0A) { + if (data[i] === 0x0A) { enqueueLine(lineBuffer); lineBuffer = ""; } else {