diff --git a/.eslintignore b/.eslintignore index 8b7cd1182e6a..09044a7076c3 100644 --- a/.eslintignore +++ b/.eslintignore @@ -166,22 +166,17 @@ devtools/server/tests/unit/sourcemapped.js devtools/server/tests/unit/xpcshell_debugging_script.js # dom/ exclusions -dom/abort/** dom/animation/** -dom/asmjscache/** -dom/battery/** dom/base/*.* dom/base/test/*.* dom/base/test/unit/test_serializers_entities*.js dom/base/test/unit_ipc/** dom/base/test/jsmodules/** dom/bindings/** -dom/broadcastchannel/** dom/browser-element/** dom/cache/test/mochitest/** dom/cache/test/xpcshell/** dom/canvas/** -dom/console/** dom/encoding/** dom/events/** dom/fetch/** diff --git a/dom/asmjscache/test/file_slow.js b/dom/asmjscache/test/file_slow.js index 963422143c35..01917f7a60db 100644 --- a/dom/asmjscache/test/file_slow.js +++ b/dom/asmjscache/test/file_slow.js @@ -1,4 +1,4 @@ -function f1() { "use asm"; function g() {} return g } +function f1() { "use asm"; function g() {} return g; } if (this.jsFuns) { ok(jsFuns.isAsmJSModule(f1), "f1 is an asm.js module"); ok(jsFuns.isAsmJSFunction(f1()), "f1.g is an asm.js function"); @@ -10,8 +10,8 @@ function f2(stdlib, foreign, buffer) { function main(n) { n = n|0; var i = 0, sum = 0; - for (; (i|0) < (n|0); i=(i+1)|0) - sum = (sum + (i32[(i<<2)>>2]|0))|0; + for (; (i|0) < (n|0); i=(i + 1)|0) + sum = (sum + (i32[(i << 2) >> 2]|0))|0; return sum|0; } return main; @@ -41,7 +41,7 @@ function f3(stdlib, foreign, buffer) { function main() { var i = 0, sum = 0; while (1) { - for (i = 0; (i|0) < 1000; i=(i+1)|0) + for (i = 0; (i|0) < 1000; i=(i + 1)|0) sum = (sum + i)|0; if (done(sum|0)|0) break; @@ -58,7 +58,7 @@ function done(sum) { lastSum = sum; return (Date.now() - begin) > 3000; } -var f3Main = f3(this, {done:done}, i32.buffer); +var f3Main = f3(this, {done}, i32.buffer); if (this.jsFuns) ok(jsFuns.isAsmJSFunction(f3Main), "f3.main is an asm.js function"); diff --git a/dom/asmjscache/test/test_cachingBasic.html b/dom/asmjscache/test/test_cachingBasic.html index f491fe9fa2bb..527f3e547d03 100644 --- a/dom/asmjscache/test/test_cachingBasic.html +++ b/dom/asmjscache/test/test_cachingBasic.html @@ -30,8 +30,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=929236 ok(code.length > 100000, "code is long enough to definitely hit the cache"); function evalAsync(code) { - var blob = new Blob([code], {type:"application/javascript"}); - var script = document.createElement('script'); + var blob = new Blob([code], {type: "application/javascript"}); + var script = document.createElement("script"); script.src = URL.createObjectURL(blob); document.body.appendChild(script); } @@ -44,7 +44,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=929236 evalAsync(code); break; case 1: - ok(jsFuns.isAsmJSModuleLoadedFromCache(module), 'module loaded from cache'); + ok(jsFuns.isAsmJSModuleLoadedFromCache(module), "module loaded from cache"); SimpleTest.finish(); break; default: diff --git a/dom/asmjscache/test/test_cachingMulti.html b/dom/asmjscache/test/test_cachingMulti.html index ceaf75812b4a..bee76e0f9062 100644 --- a/dom/asmjscache/test/test_cachingMulti.html +++ b/dom/asmjscache/test/test_cachingMulti.html @@ -45,8 +45,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=944821 } function evalAsync(code) { - var blob = new Blob([code], {type:"application/javascript"}); - var script = document.createElement('script'); + var blob = new Blob([code], {type: "application/javascript"}); + var script = document.createElement("script"); script.src = URL.createObjectURL(blob); document.body.appendChild(script); } @@ -55,13 +55,13 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=944821 function finishedEvalAsync() { finishedCount++; - if (finishedCount < 1 || finishedCount > 2*N) { + if (finishedCount < 1 || finishedCount > 2 * N) { throw "Huh?!"; } else if (finishedCount == N) { assertCacheHit = true; for (var i = 0; i < N; i++) evalAsync(codes[i]); - } else if (finishedCount == 2*N) { + } else if (finishedCount == 2 * N) { SimpleTest.finish(); } } diff --git a/dom/asmjscache/test/test_slow.html b/dom/asmjscache/test/test_slow.html index 2f19041b3816..88325f026d43 100644 --- a/dom/asmjscache/test/test_slow.html +++ b/dom/asmjscache/test/test_slow.html @@ -31,11 +31,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=854209 script.src = "http://mochi.test:8888/tests/dom/asmjscache/test/file_slow.js"; document.body.appendChild(script); - var w = new Worker('http://mochi.test:8888/tests/dom/asmjscache/test/file_slow.js'); + var w = new Worker("http://mochi.test:8888/tests/dom/asmjscache/test/file_slow.js"); w.onmessage = function(e) { ok(e.data === "ok", "Worker asm.js tests"); complete(); - } + }; SimpleTest.waitForExplicitFinish(); } diff --git a/dom/asmjscache/test/test_workers.html b/dom/asmjscache/test/test_workers.html index 6704459f6dd3..478340ced3df 100644 --- a/dom/asmjscache/test/test_workers.html +++ b/dom/asmjscache/test/test_workers.html @@ -28,7 +28,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=941830 var workerCode = asmjsCode; workerCode += "if (f()() !== 42) postMessage('fail'); else postMessage('ok');"; workerCode = 'var code = "' + workerCode + '"; eval(code); eval(code)'; - var workerBlob = new Blob([workerCode], {type:"application/javascript"}); + var workerBlob = new Blob([workerCode], {type: "application/javascript"}); var mainCode = asmjsCode; mainCode += "ok(jsFuns.isAsmJSModuleLoadedFromCache(f), 'f is a cache hit')\n"; @@ -36,7 +36,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=941830 mainCode += "ok(jsFuns.isAsmJSFunction(g42), 'g42 is an asm.js function');\n"; mainCode += "ok(g42() === 42, 'g42 returns the correct result');\n"; mainCode += "SimpleTest.finish();\n"; - var mainBlob = new Blob([mainCode], {type:"application/javascript"}); + var mainBlob = new Blob([mainCode], {type: "application/javascript"}); var w = new Worker(URL.createObjectURL(workerBlob)); @@ -51,14 +51,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=941830 ok(e.data === "ok", "Received second message"); received = 2; - var script = document.createElement('script'); + var script = document.createElement("script"); script.src = URL.createObjectURL(mainBlob); document.body.appendChild(script); break; default: throw "Huh?"; } - } + }; SimpleTest.waitForExplicitFinish(); } diff --git a/dom/battery/test/test_battery_basics.html b/dom/battery/test/test_battery_basics.html index 96f7f33685bc..eb29e7c8cc69 100644 --- a/dom/battery/test/test_battery_basics.html +++ b/dom/battery/test/test_battery_basics.html @@ -20,10 +20,10 @@ SimpleTest.waitForExplicitFinish(); ok("getBattery" in navigator, "navigator.getBattery should exist"); ok(!("battery" in navigator), "navigator.battery should not exist"); -navigator.getBattery().then(function (battery) { +navigator.getBattery().then(function(battery) { ok(battery.level >= 0.0 && battery.level <= 1.0, "Battery level " + battery.level + " should be in the range [0.0, 1.0]"); - SpecialPowers.pushPrefEnv({"set": [["dom.battery.test.default", true]]}, function () { + SpecialPowers.pushPrefEnv({"set": [["dom.battery.test.default", true]]}, function() { ok(battery.charging, "Battery should be charging by default"); is(battery.chargingTime, 0, "Battery chargingTime " + battery.chargingTime + " should be zero by default"); is(battery.dischargingTime, Infinity, "Battery dischargingTime should be Infinity by default"); diff --git a/dom/battery/test/test_battery_charging.html b/dom/battery/test/test_battery_charging.html index 5d1e83284843..8ccdf3642040 100644 --- a/dom/battery/test/test_battery_charging.html +++ b/dom/battery/test/test_battery_charging.html @@ -17,10 +17,10 @@ SimpleTest.waitForExplicitFinish(); /** Test for Battery API **/ -navigator.getBattery().then(function (battery) { +navigator.getBattery().then(function(battery) { ok(battery.level >= 0.0 && battery.level <= 1.0, "Battery level " + battery.level + " should be in the range [0.0, 1.0]"); - SpecialPowers.pushPrefEnv({"set": [["dom.battery.test.charging", true]]}, function () { + SpecialPowers.pushPrefEnv({"set": [["dom.battery.test.charging", true]]}, function() { is(battery.charging, true, "Battery should be charging"); ok(battery.chargingTime >= 0, "Battery chargingTime " + battery.chargingTime + " should be nonnegative when charging"); is(battery.dischargingTime, Infinity, "Battery dischargingTime should be Infinity when charging"); diff --git a/dom/battery/test/test_battery_discharging.html b/dom/battery/test/test_battery_discharging.html index 26a0359d3b89..5b5d867dfaac 100644 --- a/dom/battery/test/test_battery_discharging.html +++ b/dom/battery/test/test_battery_discharging.html @@ -17,10 +17,10 @@ SimpleTest.waitForExplicitFinish(); /** Test for Battery API **/ -navigator.getBattery().then(function (battery) { +navigator.getBattery().then(function(battery) { ok(battery.level >= 0.0 && battery.level <= 1.0, "Battery level " + battery.level + " should be in the range [0.0, 1.0]"); - SpecialPowers.pushPrefEnv({"set": [["dom.battery.test.discharging", true]]}, function () { + SpecialPowers.pushPrefEnv({"set": [["dom.battery.test.discharging", true]]}, function() { is(battery.charging, false, "Battery should be discharging"); is(battery.chargingTime, Infinity, "Battery chargingTime should be Infinity when discharging"); ok(battery.dischargingTime > 0, "Battery dischargingTime " + battery.dischargingTime + " should be positive when discharging"); diff --git a/dom/broadcastchannel/tests/broadcastchannel_sharedWorker.js b/dom/broadcastchannel/tests/broadcastchannel_sharedWorker.js index bfc6a88d33a3..01d9062ed2b5 100644 --- a/dom/broadcastchannel/tests/broadcastchannel_sharedWorker.js +++ b/dom/broadcastchannel/tests/broadcastchannel_sharedWorker.js @@ -1,12 +1,12 @@ onconnect = function(evt) { evt.ports[0].onmessage = function(evt) { - var bc = new BroadcastChannel('foobar'); - bc.addEventListener('message', function(event) { + var bc = new BroadcastChannel("foobar"); + bc.addEventListener("message", function(event) { bc.postMessage(event.data == "hello world from the window" ? "hello world from the worker" : "KO"); bc.close(); }); evt.target.postMessage("READY"); - } -} + }; +}; diff --git a/dom/broadcastchannel/tests/broadcastchannel_worker.js b/dom/broadcastchannel/tests/broadcastchannel_worker.js index 18648295bba7..7fb5f8026ee0 100644 --- a/dom/broadcastchannel/tests/broadcastchannel_worker.js +++ b/dom/broadcastchannel/tests/broadcastchannel_worker.js @@ -3,16 +3,16 @@ onmessage = function(evt) { var worker = new Worker("broadcastchannel_worker.js"); worker.onmessage = function(evt) { postMessage(evt.data); - } + }; worker.postMessage(evt.data - 1); return; } - var bc = new BroadcastChannel('foobar'); - bc.addEventListener('message', function(event) { + var bc = new BroadcastChannel("foobar"); + bc.addEventListener("message", function(event) { bc.postMessage(event.data == "hello world from the window" ? "hello world from the worker" : "KO"); bc.close(); }); postMessage("READY"); -} +}; diff --git a/dom/broadcastchannel/tests/broadcastchannel_worker_alive.js b/dom/broadcastchannel/tests/broadcastchannel_worker_alive.js index d2b244aaa423..f5be8a400538 100644 --- a/dom/broadcastchannel/tests/broadcastchannel_worker_alive.js +++ b/dom/broadcastchannel/tests/broadcastchannel_worker_alive.js @@ -1,7 +1,7 @@ -(new BroadcastChannel('foobar')).addEventListener('message', function(event) { - if (event.data != 'READY') { +(new BroadcastChannel("foobar")).addEventListener("message", function(event) { + if (event.data != "READY") { event.target.postMessage(event.data); } }); -(new BroadcastChannel('foobar')).postMessage('READY'); +(new BroadcastChannel("foobar")).postMessage("READY"); diff --git a/dom/broadcastchannel/tests/broadcastchannel_worker_any.js b/dom/broadcastchannel/tests/broadcastchannel_worker_any.js index da8625c4d8e9..bb4506eccf2d 100644 --- a/dom/broadcastchannel/tests/broadcastchannel_worker_any.js +++ b/dom/broadcastchannel/tests/broadcastchannel_worker_any.js @@ -1,5 +1,5 @@ -(new BroadcastChannel('foobar')).onmessage = function(event) { +(new BroadcastChannel("foobar")).onmessage = function(event) { event.target.postMessage(event.data); -} +}; postMessage("READY"); diff --git a/dom/broadcastchannel/tests/browser_private_browsing.js b/dom/broadcastchannel/tests/browser_private_browsing.js index 35fa0aff755c..ae4f98fac9bf 100644 --- a/dom/broadcastchannel/tests/browser_private_browsing.js +++ b/dom/broadcastchannel/tests/browser_private_browsing.js @@ -30,39 +30,39 @@ add_task(async function() { var p1 = ContentTask.spawn(browser1, null, function(opts) { return new content.window.Promise(resolve => { - content.window.bc = new content.window.BroadcastChannel('foobar'); - content.window.bc.onmessage = function(e) { resolve(e.data); } + content.window.bc = new content.window.BroadcastChannel("foobar"); + content.window.bc.onmessage = function(e) { resolve(e.data); }; }); }); var p2 = ContentTask.spawn(browser2, null, function(opts) { return new content.window.Promise(resolve => { - content.window.bc = new content.window.BroadcastChannel('foobar'); - content.window.bc.onmessage = function(e) { resolve(e.data); } + content.window.bc = new content.window.BroadcastChannel("foobar"); + content.window.bc.onmessage = function(e) { resolve(e.data); }; }); }); await ContentTask.spawn(browser1, null, function(opts) { return new content.window.Promise(resolve => { - var bc = new content.window.BroadcastChannel('foobar'); - bc.postMessage('hello world from private browsing'); + var bc = new content.window.BroadcastChannel("foobar"); + bc.postMessage("hello world from private browsing"); resolve(); }); }); await ContentTask.spawn(browser2, null, function(opts) { return new content.window.Promise(resolve => { - var bc = new content.window.BroadcastChannel('foobar'); - bc.postMessage('hello world from non private browsing'); + var bc = new content.window.BroadcastChannel("foobar"); + bc.postMessage("hello world from non private browsing"); resolve(); }); }); var what1 = await p1; - is(what1, 'hello world from private browsing', 'No messages received from the other window.'); + is(what1, "hello world from private browsing", "No messages received from the other window."); var what2 = await p2; - is(what2, 'hello world from non private browsing', 'No messages received from the other window.'); + is(what2, "hello world from non private browsing", "No messages received from the other window."); BrowserTestUtils.removeTab(tab1); await BrowserTestUtils.closeWindow(win1); diff --git a/dom/broadcastchannel/tests/file_mozbrowser.html b/dom/broadcastchannel/tests/file_mozbrowser.html index 9985b273f83f..6370500d989d 100644 --- a/dom/broadcastchannel/tests/file_mozbrowser.html +++ b/dom/broadcastchannel/tests/file_mozbrowser.html @@ -8,11 +8,11 @@
diff --git a/dom/broadcastchannel/tests/file_mozbrowser2.html b/dom/broadcastchannel/tests/file_mozbrowser2.html index e45a4d9cfed3..2e5f394eb891 100644 --- a/dom/broadcastchannel/tests/file_mozbrowser2.html +++ b/dom/broadcastchannel/tests/file_mozbrowser2.html @@ -8,12 +8,12 @@ diff --git a/dom/broadcastchannel/tests/iframe_broadcastchannel.html b/dom/broadcastchannel/tests/iframe_broadcastchannel.html index fb9a12b4bdde..3c6ead800617 100644 --- a/dom/broadcastchannel/tests/iframe_broadcastchannel.html +++ b/dom/broadcastchannel/tests/iframe_broadcastchannel.html @@ -15,18 +15,18 @@ ok("BroadcastChannel" in window, "BroadcastChannel exists"); var bc = new BroadcastChannel("foobar"); ok(bc, "BroadcastChannel can be created"); -is(bc.name, 'foobar', "BroadcastChannel.name is foobar"); +is(bc.name, "foobar", "BroadcastChannel.name is foobar"); ok("postMessage" in bc, "BroadcastChannel has postMessage() method"); bc.onmessage = function(evt) { - ok(evt instanceof MessageEvent, 'evt is a MessageEvent'); - is(evt.target, bc, 'MessageEvent.target is bc'); - is(evt.target.name, 'foobar', 'MessageEvent.target.name is foobar'); - is(evt.target.name, bc.name, 'MessageEvent.target.name is bc.name'); + ok(evt instanceof MessageEvent, "evt is a MessageEvent"); + is(evt.target, bc, "MessageEvent.target is bc"); + is(evt.target.name, "foobar", "MessageEvent.target.name is foobar"); + is(evt.target.name, bc.name, "MessageEvent.target.name is bc.name"); is(evt.data, "Hello world from the window!", "Message received from the window"); bc.postMessage("Hello world from the iframe!"); -} +};