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

Commit

Permalink
Bug 1346671 - Enable the no-useless-concat eslint rule in toolkit/ r=…
Browse files Browse the repository at this point in the history
…jaws

MozReview-Commit-ID: 1a422BiLEhK
  • Loading branch information
Jim Porter committed Mar 13, 2017
1 parent fed7051 commit d3aee6d
Show file tree
Hide file tree
Showing 15 changed files with 20 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ add_task(function* () {
// Hack the planet! Load our blocklist shim, so we can mess with blocklist
// return results in the content process. Active until we close our tab.
let mm = gTestBrowser.messageManager;
info("test 3a: loading " + gChromeRoot + "blocklist_proxy.js" + "\n");
info("test 3a: loading " + gChromeRoot + "blocklist_proxy.js\n");
mm.loadFrameScript(gChromeRoot + "blocklist_proxy.js", true);

yield promiseTabLoadEvent(gBrowser.selectedTab, gTestRoot + "plugin_test.html");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function waitForPageLoad(aTab) {
function onTabLoad(event) {
clearTimeout(timeoutId);
aTab.linkedBrowser.removeEventListener("load", onTabLoad, true);
info("Tab event received: " + "load");
info("Tab event received: load");
deferred.resolve();
}
aTab.linkedBrowser.addEventListener("load", onTabLoad, true, true);
Expand Down
2 changes: 1 addition & 1 deletion browser/components/migration/ESEDBReader.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ ESEDB.prototype = {
// Deal with null values:
buffer = null;
} else {
Cu.reportError("Unexpected JET error: " + err + ";" + " retrieving value for column " + column.name);
Cu.reportError("Unexpected JET error: " + err + "; retrieving value for column " + column.name);
throw new Error(convertESEError(err));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ add_task(function* test() {
} else {
page_with_title = test_title + " - " + app_name;
page_without_title = app_name;
about_pb_title = "Open a private window?" + " - " + app_name;
about_pb_title = "Open a private window? - " + app_name;
pb_page_with_title = test_title + " - " + app_name + " (Private Browsing)";
pb_page_without_title = app_name + " (Private Browsing)";
pb_about_pb_title = "Private Browsing - " + app_name + " (Private Browsing)";
Expand Down
2 changes: 1 addition & 1 deletion browser/extensions/pdfjs/test/browser_pdfjs_zoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ add_task(function* test() {

yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:blank" },
function* (newTabBrowser) {
yield waitForPdfJS(newTabBrowser, TESTROOT + "file_pdfjs_test.pdf" + "#zoom=100");
yield waitForPdfJS(newTabBrowser, TESTROOT + "file_pdfjs_test.pdf#zoom=100");

yield ContentTask.spawn(newTabBrowser, TESTS, function* (contentTESTS) {
let document = content.document;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function isSecurityState(expectedState, message, test) {
gotState = "EV";
}

test(gotState == expectedState, (message || "") + ", " + "expected " + expectedState + " got " + gotState);
test(gotState == expectedState, (message || "") + ", expected " + expectedState + " got " + gotState);

switch (expectedState) {
case "insecure":
Expand Down
4 changes: 4 additions & 0 deletions toolkit/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ module.exports = {

// Only check typeof against valid results
"valid-typeof": "error",

// Don't concatenate string literals together (unless they span multiple
// lines)
"no-useless-concat": "error",
},
"env": {
"es6": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ add_task(function* test_same_date_diff_hash() {
let {count} = yield BookmarkJSONUtils.exportToFile(tempPath);
let dateObj = new Date();
let filename = "bookmarks-" + PlacesBackups.toISODateString(dateObj) + "_" +
count + "_" + "differentHash==" + ".json";
count + "_differentHash==.json";
let backupFile = OS.Path.join(backupFolder, filename);
yield OS.File.move(tempPath, backupFile);
yield PlacesBackups.create(); // Force compressed backup
Expand Down
2 changes: 1 addition & 1 deletion toolkit/components/places/tests/bookmarks/test_1129529.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ add_task(function* () {
index: 1,
id: 4,
charset: "UTF-8",
tags: "tag1," + "a" + "0123456789".repeat(10), // 101 chars
tags: "tag1,a" + "0123456789".repeat(10), // 101 chars
type: "text/x-moz-place",
dateAdded: now,
lastModified: now,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1327,7 +1327,7 @@ add_task(function* test_preventive_maintenance() {
do_check_true(defaultBookmarksMaxId > 0);

for (let test of tests) {
dump("\nExecuting test: " + test.name + "\n" + "*** " + test.desc + "\n");
dump("\nExecuting test: " + test.name + "\n*** " + test.desc + "\n");
yield test.setup();

let promiseMaintenanceFinished =
Expand Down
2 changes: 1 addition & 1 deletion toolkit/components/tooltiptext/tests/browser_bug581947.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function check(aBrowser, aElementName, aBarred, aType) {
"No tooltip should be shown when the element is barred from constraint validation");
} else {
ok(tttp.getNodeText(e, {}, {}),
e.tagName + " " + "A tooltip should be shown when the element isn't valid");
e.tagName + " A tooltip should be shown when the element isn't valid");
}

e.setAttribute("title", "");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
var win;
function startTest() {
var videoURL = new URL("seek_with_sound.ogg", document.documentURI).href;

// eslint-disable-next-line no-useless-concat
var url = "data:text/html,<video src=" + videoURL + " controls autoplay=true></video><script>window.testExpando = true;</scr" + "ipt>";

win = window.open(url);
Expand Down
2 changes: 1 addition & 1 deletion toolkit/modules/Console.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ function stringify(aThing, aAllowNewLines) {
json = JSON.stringify(aThing);
} catch (ex) {
// Can't use a real ellipsis here, because cmd.exe isn't unicode-enabled
json = "{" + Object.keys(aThing).join(":..,") + ":.., " + "}";
json = "{" + Object.keys(aThing).join(":..,") + ":.., }";
}
return type + json;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ function check_results(aActualAddons, aExpectedAddons, aAddonCount, aInstallNull
if (aActualAddon.name == "FAIL")
do_throw(aActualAddon.id + " - " + aActualAddon.description);
if (aActualAddon.name != "PASS")
do_throw(aActualAddon.id + " - " + "invalid add-on name " + aActualAddon.name);
do_throw(aActualAddon.id + " - invalid add-on name " + aActualAddon.name);

do_check_eq(aActualAddon.install == null, !!aInstallNull || !aActualAddon.sourceURI);

Expand Down
3 changes: 2 additions & 1 deletion toolkit/mozapps/update/nsUpdateService.js
Original file line number Diff line number Diff line change
Expand Up @@ -3996,7 +3996,8 @@ Downloader.prototype = {
maxFail = Math.min(maxFail, 20);
LOG("Downloader:onStopRequest - status: " + status + ", " +
"current fail: " + this.updateService._consecutiveSocketErrors + ", " +
"max fail: " + maxFail + ", " + "retryTimeout: " + retryTimeout);
"max fail: " + maxFail + ", " +
"retryTimeout: " + retryTimeout);
if (Components.isSuccessCode(status)) {
if (this._verifyDownload()) {
if (shouldUseService()) {
Expand Down

0 comments on commit d3aee6d

Please sign in to comment.