diff --git a/.eslintignore b/.eslintignore index 5819f278fdf9..114812d3b7cd 100644 --- a/.eslintignore +++ b/.eslintignore @@ -138,12 +138,17 @@ intl/l10n/ # Exclude everything but self-hosted JS js/examples/ js/public/ -js/xpconnect/ js/src/devtools/ js/src/jit-test/ js/src/tests/ js/src/Y.js +# Changes to XPConnect tests must be carefully audited. +js/xpconnect/loader/ +js/xpconnect/tests/browser/ +js/xpconnect/tests/mochitest/ +js/xpconnect/tests/unit/ + # Fuzzing code for testing only, targeting the JS shell js/src/fuzz-tests/ diff --git a/js/xpconnect/tests/chrome/bug503926.xhtml b/js/xpconnect/tests/chrome/bug503926.xhtml index 07f4ec236aac..bfd5470305d6 100644 --- a/js/xpconnect/tests/chrome/bug503926.xhtml +++ b/js/xpconnect/tests/chrome/bug503926.xhtml @@ -18,7 +18,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=503926 var gWindowUtils = window.windowUtils; var passed = false; // eslint-disable-next-line mozilla/use-chromeutils-generateqi - var obj = { QueryInterface: function() { passed = true; } } + var obj = { QueryInterface() { passed = true; } } gWindowUtils.xpconnectArgument(obj); var isDialog = location.hash != '#iframe'; var outer = XPCNativeWrapper.unwrap(isDialog ? window.arguments[0] : parent); diff --git a/js/xpconnect/tests/chrome/file_expandosharing.jsm b/js/xpconnect/tests/chrome/file_expandosharing.jsm index 78718b28ec1c..f680ae20a993 100644 --- a/js/xpconnect/tests/chrome/file_expandosharing.jsm +++ b/js/xpconnect/tests/chrome/file_expandosharing.jsm @@ -1,4 +1,4 @@ -var EXPORTED_SYMBOLS = ['checkFromJSM']; +var EXPORTED_SYMBOLS = ["checkFromJSM"]; function checkFromJSM(target, is_op) { is_op(target.numProp, 42, "Number expando works"); @@ -6,5 +6,7 @@ function checkFromJSM(target, is_op) { // If is_op is todo_is, target.objProp will be undefined. try { is_op(target.objProp.bar, "baz", "Object expando works"); - } catch(e) { is_op(0, 1, "No object expando"); } -} \ No newline at end of file + } catch (e) { + is_op(0, 1, "No object expando"); + } +} diff --git a/js/xpconnect/tests/chrome/outoflinexulscript.js b/js/xpconnect/tests/chrome/outoflinexulscript.js index a06b633afd99..14b99048e9c9 100644 --- a/js/xpconnect/tests/chrome/outoflinexulscript.js +++ b/js/xpconnect/tests/chrome/outoflinexulscript.js @@ -1,6 +1,5 @@ // Some unicode characters that must be decoded: // ……………………………………………………………………………………………………………………………… function outoflinefunction() { - return 42; + return 42; } - diff --git a/js/xpconnect/tests/chrome/test_APIExposer.xhtml b/js/xpconnect/tests/chrome/test_APIExposer.xhtml index 4044474df24f..b327abe44d13 100644 --- a/js/xpconnect/tests/chrome/test_APIExposer.xhtml +++ b/js/xpconnect/tests/chrome/test_APIExposer.xhtml @@ -29,7 +29,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=634156 function genPropDesc(value) { return { enumerable: true, configurable: true, writable: true, - value: value }; + value }; } const props = { 'getProp': genPropDesc(function() { ok(true, "called prop that shadowed a getter"); }), diff --git a/js/xpconnect/tests/chrome/test_bug1041626.xhtml b/js/xpconnect/tests/chrome/test_bug1041626.xhtml index 3f970df60d12..61d763083806 100644 --- a/js/xpconnect/tests/chrome/test_bug1041626.xhtml +++ b/js/xpconnect/tests/chrome/test_bug1041626.xhtml @@ -42,7 +42,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1041626 xrayOwnProperties = Object.getOwnPropertyNames(window[0].document); realOwnProperties = Object.getOwnPropertyNames(window[0].wrappedJSObject.document); - ok(realOwnProperties.length > 0); + ok(!!realOwnProperties.length); is(xrayOwnProperties.sort().toSource(), realOwnProperties.sort().toSource(), "Xray enumerates document properties properly"); diff --git a/js/xpconnect/tests/chrome/test_bug1074863.html b/js/xpconnect/tests/chrome/test_bug1074863.html index 7dcad965e563..2fbe69a547b5 100644 --- a/js/xpconnect/tests/chrome/test_bug1074863.html +++ b/js/xpconnect/tests/chrome/test_bug1074863.html @@ -12,7 +12,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1074863