Bug 1407968 - Add an exception for ESLint no-self-compare in test_complex_keyPaths.js as the comparisons are intentional. r?bevis
MozReview-Commit-ID: 7rSKeU9qtja
--- a/dom/indexedDB/test/unit/test_complex_keyPaths.js
+++ b/dom/indexedDB/test/unit/test_complex_keyPaths.js
@@ -80,16 +80,17 @@ function* testSteps()
let test = " for objectStore test " + JSON.stringify(info);
let indexName = JSON.stringify(info.keyPath);
if (!stores[indexName]) {
try {
let objectStore = db.createObjectStore(indexName, { keyPath: info.keyPath });
ok(!("exception" in info), "shouldn't throw" + test);
is(JSON.stringify(objectStore.keyPath), JSON.stringify(info.keyPath),
"correct keyPath property" + test);
+ // eslint-disable-next-line no-self-compare
ok(objectStore.keyPath === objectStore.keyPath,
"object identity should be preserved");
stores[indexName] = objectStore;
} catch (e) {
ok("exception" in info, "should throw" + test);
is(e.name, "SyntaxError", "expect a SyntaxError" + test);
ok(e instanceof DOMException, "Got a DOM Exception" + test);
is(e.code, DOMException.SYNTAX_ERR, "expect a syntax error" + test);
@@ -169,16 +170,17 @@ function* testSteps()
let test = " for index test " + JSON.stringify(info);
let indexName = JSON.stringify(info.keyPath);
if (!indexes[indexName]) {
try {
let index = store.createIndex(indexName, info.keyPath);
ok(!("exception" in info), "shouldn't throw" + test);
is(JSON.stringify(index.keyPath), JSON.stringify(info.keyPath),
"index has correct keyPath property" + test);
+ // eslint-disable-next-line no-self-compare
ok(index.keyPath === index.keyPath,
"object identity should be preserved");
indexes[indexName] = index;
} catch (e) {
ok("exception" in info, "should throw" + test);
is(e.name, "SyntaxError", "expect a SyntaxError" + test);
ok(e instanceof DOMException, "Got a DOM Exception" + test);
is(e.code, DOMException.SYNTAX_ERR, "expect a syntax error" + test);