Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Bug 1328800 - Enable the no-sparse-arrays rule for eslint and change …
Browse files Browse the repository at this point in the history
…the two instances of it to use 'undefined' instead of a sparse array since the test will still be fine either way. r=mak

MozReview-Commit-ID: 5oceKd1EJYR
  • Loading branch information
msujaws committed Jan 5, 2017
1 parent 5eaacfd commit 88b29a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions toolkit/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ module.exports = {
// No declaring variables that hide things like arguments
"no-shadow-restricted-names": "error",

// Disallow sparse arrays
"no-sparse-arrays": "error",

// No trailing whitespace
"no-trailing-spaces": "error",

Expand Down
4 changes: 2 additions & 2 deletions toolkit/components/places/tests/unit/test_tagging.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,13 @@ function run_test() {
let curChildCount = tagRoot.childCount;

try {
tagssvc.tagURI(uri1, [, "tagSparse"]);
tagssvc.tagURI(uri1, [undefined, "tagSparse"]);
do_check_eq(tagRoot.childCount, curChildCount + 1);
} catch (ex) {
do_throw("Passing a sparse array should not throw");
}
try {
tagssvc.untagURI(uri1, [, "tagSparse"]);
tagssvc.untagURI(uri1, [undefined, "tagSparse"]);
do_check_eq(tagRoot.childCount, curChildCount);
} catch (ex) {
do_throw("Passing a sparse array should not throw");
Expand Down

0 comments on commit 88b29a7

Please sign in to comment.