diff --git a/testing/mochitest/mochitest.eslintrc.js b/testing/mochitest/mochitest.eslintrc.js index 3532ecf7454c..137fbabf4720 100644 --- a/testing/mochitest/mochitest.eslintrc.js +++ b/testing/mochitest/mochitest.eslintrc.js @@ -12,6 +12,8 @@ module.exports = { // All globals made available in the test environment. "globals": { + // $ is defined in SimpleTest.js + "$": false, "add_task": false, "Assert": false, "EventUtils": false, @@ -25,6 +27,7 @@ module.exports = { "is": false, "isDeeply": false, "isnot": false, + "netscape": false, "ok": false, "promise": false, "registerCleanupFunction": false, diff --git a/testing/xpcshell/xpcshell.eslintrc.js b/testing/xpcshell/xpcshell.eslintrc.js index 4f8fc3d5185f..87b99af5aed4 100644 --- a/testing/xpcshell/xpcshell.eslintrc.js +++ b/testing/xpcshell/xpcshell.eslintrc.js @@ -8,10 +8,12 @@ module.exports = { // All globals made available in the test environment. "globals": { + "_TEST_FILE": false, "add_task": false, "add_test": false, "Assert": false, "deepEqual": false, + "do_await_remote_message": false, "do_check_eq": false, "do_check_false": false, "do_check_matches": false, @@ -30,6 +32,7 @@ module.exports = { "do_print": false, "do_register_cleanup": false, "do_report_unexpected_exception": false, + "do_send_remote_message": false, "do_test_finished": false, "do_test_pending": false, "do_throw": false, @@ -45,6 +48,7 @@ module.exports = { "notEqual": false, "notStrictEqual": false, "ok": false, + "runningInParent": false, "run_next_test": false, "run_test": false, "run_test_in_child": false, @@ -53,5 +57,8 @@ module.exports = { "todo": false, "todo_check_false": false, "todo_check_true": false, + // Firefox specific function. + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/uneval + "uneval": false, } }; diff --git a/toolkit/.eslintrc.js b/toolkit/.eslintrc.js index 5e23b48151fd..c79d8702d966 100644 --- a/toolkit/.eslintrc.js +++ b/toolkit/.eslintrc.js @@ -208,5 +208,6 @@ module.exports = { "dump": true, "openDialog": false, "sizeToContent": false, + "ChromeWorker": false, } }; diff --git a/toolkit/components/contextualidentity/tests/unit/.eslintrc.js b/toolkit/components/contextualidentity/tests/unit/.eslintrc.js new file mode 100644 index 000000000000..d35787cd2c49 --- /dev/null +++ b/toolkit/components/contextualidentity/tests/unit/.eslintrc.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = { + "extends": [ + "../../../../../testing/xpcshell/xpcshell.eslintrc.js" + ] +}; diff --git a/toolkit/components/cookie/content/cookieAcceptDialog.js b/toolkit/components/cookie/content/cookieAcceptDialog.js index 0c605295b42a..41311fe8e751 100644 --- a/toolkit/components/cookie/content/cookieAcceptDialog.js +++ b/toolkit/components/cookie/content/cookieAcceptDialog.js @@ -92,7 +92,7 @@ function onload() // use childnodes here, the text can wrap for (var i = 1; i < messageParagraphs.length; i++) { var descriptionNode = document.createElement("description"); - text = document.createTextNode(messageParagraphs[i]); + let text = document.createTextNode(messageParagraphs[i]); descriptionNode.appendChild(text); messageParent.appendChild(descriptionNode); } diff --git a/toolkit/components/ctypes/tests/unit/test_finalizer.js b/toolkit/components/ctypes/tests/unit/test_finalizer.js index f580279fe304..d50437da6eb5 100644 --- a/toolkit/components/ctypes/tests/unit/test_finalizer.js +++ b/toolkit/components/ctypes/tests/unit/test_finalizer.js @@ -259,7 +259,7 @@ function run_test() // if we want to avoid tests overlapping. function test_cycles(size, tc) { // Now, restart this with unreferenced cycles - for (i = 0; i < size / 2; ++i) { + for (let i = 0; i < size / 2; ++i) { let a = { a: ctypes.CDataFinalizer(tc.acquire(i * 2), tc.release), b: { @@ -325,7 +325,7 @@ function test_result_dispose(size, tc, cleanup) { } do_check_eq(count_finalized(size, tc), 0); - for (i = 0; i < size; ++i) { + for (let i = 0; i < size; ++i) { let witness = ref[i].dispose(); ref[i] = null; if (!tc.released(i, witness)) { @@ -367,7 +367,7 @@ function test_executing_dispose(size, tc, cleanup) ref = []; // Re-acquire data and make sure that everything has been reinialized - for (i = 0; i < size; ++i) { + for (let i = 0; i < size; ++i) { tc.acquire(i); } @@ -449,4 +449,3 @@ function test_do_not_execute_finalizers_on_referenced_stuff(size, tc, cleanup) // Check that _nothing_ has been finalized do_check_eq(count_finalized(size, tc), 0); } - diff --git a/toolkit/components/ctypes/tests/unit/test_jsctypes.js b/toolkit/components/ctypes/tests/unit/test_jsctypes.js index ea8fcee70518..18861a185c3c 100644 --- a/toolkit/components/ctypes/tests/unit/test_jsctypes.js +++ b/toolkit/components/ctypes/tests/unit/test_jsctypes.js @@ -10,8 +10,8 @@ try { } catch (e) { } -CTYPES_TEST_LIB = ctypes.libraryName("jsctypes-test"); -CTYPES_UNICODE_LIB = ctypes.libraryName("jsctyp\u00E8s-t\u00EB\u00DFt"); +const CTYPES_TEST_LIB = ctypes.libraryName("jsctypes-test"); +const CTYPES_UNICODE_LIB = ctypes.libraryName("jsctyp\u00E8s-t\u00EB\u00DFt"); function do_check_throws(f, type, stack) { @@ -72,9 +72,9 @@ function run_test() run_float_tests(library, ctypes.double, "double", 8); // Test the wrapped integer types. - s64limits = ["-9223372036854775808", "9223372036854775807", - "-9223372036854775809", "9223372036854775808"]; - u64limits = ["0", "18446744073709551615", "-1", "18446744073709551616"]; + const s64limits = ["-9223372036854775808", "9223372036854775807", + "-9223372036854775809", "9223372036854775808"]; + const u64limits = ["0", "18446744073709551615", "-1", "18446744073709551616"]; run_wrapped_integer_tests(library, ctypes.int64_t, "int64_t", 8, true, ctypes.Int64, "ctypes.Int64", s64limits); @@ -85,8 +85,8 @@ function run_test() run_wrapped_integer_tests(library, ctypes.unsigned_long_long, "unsigned_long_long", 8, false, ctypes.UInt64, "ctypes.UInt64", u64limits); - s32limits = [-0x80000000, 0x7fffffff, -0x80000001, 0x80000000]; - u32limits = [0, 0xffffffff, -1, 0x100000000]; + const s32limits = [-0x80000000, 0x7fffffff, -0x80000001, 0x80000000]; + const u32limits = [0, 0xffffffff, -1, 0x100000000]; let slimits, ulimits; if (ctypes.long.size == 8) { @@ -1771,7 +1771,7 @@ function run_PointerType_tests() { " can be converted to " + item_type + " array"); // Convert ArrayBuffer to array of the right size and check contents - c_array = array_type(c_arraybuffer); + let c_array = array_type(c_arraybuffer); for (let k = 0; k < number_of_items; ++k) { do_check_eq(c_array[k], view[k]); } @@ -2690,14 +2690,14 @@ function run_variadic_tests(library) { do_check_eq(result.value, 3 + 5 + 7 + 11); - result = ctypes.int32_t.array(3)([1, 1, 1]), - v1 = ctypes.int32_t.array(4)([1, 2, 3, 5]), - v2 = ctypes.int32_t.array(3)([7, 11, 13]), - vector_add_va = library.declare("test_vector_add_va_cdecl", + result = ctypes.int32_t.array(3)([1, 1, 1]); + let v1 = ctypes.int32_t.array(4)([1, 2, 3, 5]); + let v2 = ctypes.int32_t.array(3)([7, 11, 13]); + let vector_add_va = library.declare("test_vector_add_va_cdecl", ctypes.default_abi, ctypes.int32_t.ptr, - ctypes.uint8_t, ctypes.uint8_t, "..."), + ctypes.uint8_t, ctypes.uint8_t, "..."); // Note that vector_add_va zeroes out result first. - vec_sum = vector_add_va(2, 3, result, v1, v2); + let vec_sum = vector_add_va(2, 3, result, v1, v2); do_check_eq(vec_sum.contents, 8); do_check_eq(result[0], 8); do_check_eq(result[1], 13); diff --git a/toolkit/components/extensions/test/mochitest/.eslintrc.js b/toolkit/components/extensions/test/mochitest/.eslintrc.js index 53938410b75e..30d41f0b23ee 100644 --- a/toolkit/components/extensions/test/mochitest/.eslintrc.js +++ b/toolkit/components/extensions/test/mochitest/.eslintrc.js @@ -8,7 +8,6 @@ module.exports = { // eslint-disable-line no-undef }, "globals": { - "ChromeWorker": false, "onmessage": true, "sendAsyncMessage": false, diff --git a/toolkit/components/feeds/FeedProcessor.js b/toolkit/components/feeds/FeedProcessor.js index 682da785f3d6..305d90fa40d6 100644 --- a/toolkit/components/feeds/FeedProcessor.js +++ b/toolkit/components/feeds/FeedProcessor.js @@ -155,7 +155,7 @@ function bagHasKey(bag, key) { function makePropGetter(key) { return function FeedPropGetter(bag) { try { - return value = bag.getProperty(key); + return bag.getProperty(key); } catch (e) { } diff --git a/toolkit/components/filepicker/nsFilePicker.js b/toolkit/components/filepicker/nsFilePicker.js index 7823a8d4476b..97bb78e7631f 100644 --- a/toolkit/components/filepicker/nsFilePicker.js +++ b/toolkit/components/filepicker/nsFilePicker.js @@ -20,6 +20,7 @@ Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); const DEBUG = false; /* set to true to enable debug messages */ +var debug; const LOCAL_FILE_CONTRACTID = "@mozilla.org/file/local;1"; const APPSHELL_SERV_CONTRACTID = "@mozilla.org/appshell/appShellService;1"; diff --git a/toolkit/components/formautofill/test/xpcshell/head.js b/toolkit/components/formautofill/test/xpcshell/head.js index 1cee023f2179..082b802f0dde 100644 --- a/toolkit/components/formautofill/test/xpcshell/head.js +++ b/toolkit/components/formautofill/test/xpcshell/head.js @@ -4,9 +4,11 @@ /* * Initialization specific to Form Autofill xpcshell tests. * - * This file is loaded by "loader.js". + * This file is loaded alongside loader.js. */ +/* import-globals-from loader.js */ + "use strict"; // The testing framework is fully initialized at this point, you can add diff --git a/toolkit/components/formautofill/test/xpcshell/loader.js b/toolkit/components/formautofill/test/xpcshell/loader.js index 97a789b3eaa5..955533d4cbf5 100644 --- a/toolkit/components/formautofill/test/xpcshell/loader.js +++ b/toolkit/components/formautofill/test/xpcshell/loader.js @@ -17,6 +17,7 @@ var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components; Cu.import("resource://gre/modules/XPCOMUtils.jsm", this); Cu.import("resource://gre/modules/Services.jsm", this); +/* import-globals-from ../loader_common.js */ Services.scriptloader.loadSubScript( Services.io.newFileURI(do_get_file("loader_common.js")).spec, this); @@ -33,6 +34,7 @@ var add_task_in_parent_process = add_task; var add_task_in_child_process = function() {}; var add_task_in_both_processes = add_task; +/* import-globals-from ../head_common.js */ Services.scriptloader.loadSubScript( Services.io.newFileURI(do_get_file("head_common.js")).spec, this); diff --git a/toolkit/components/jsdownloads/src/DownloadCore.jsm b/toolkit/components/jsdownloads/src/DownloadCore.jsm index 53126fb613be..043f20cc18e9 100644 --- a/toolkit/components/jsdownloads/src/DownloadCore.jsm +++ b/toolkit/components/jsdownloads/src/DownloadCore.jsm @@ -88,6 +88,7 @@ XPCOMUtils.defineLazyServiceGetter(this, "gPrintSettingsService", "@mozilla.org/gfx/printsettings-service;1", Ci.nsIPrintSettingsService); +/* global DownloadIntegration */ Integration.downloads.defineModuleGetter(this, "DownloadIntegration", "resource://gre/modules/DownloadIntegration.jsm"); diff --git a/toolkit/components/jsdownloads/src/Downloads.jsm b/toolkit/components/jsdownloads/src/Downloads.jsm index 775416eabca9..174f807a5977 100644 --- a/toolkit/components/jsdownloads/src/Downloads.jsm +++ b/toolkit/components/jsdownloads/src/Downloads.jsm @@ -38,6 +38,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "Promise", XPCOMUtils.defineLazyModuleGetter(this, "Task", "resource://gre/modules/Task.jsm"); +/* global DownloadIntegration */ Integration.downloads.defineModuleGetter(this, "DownloadIntegration", "resource://gre/modules/DownloadIntegration.jsm"); diff --git a/toolkit/components/jsdownloads/test/unit/common_test_Download.js b/toolkit/components/jsdownloads/test/unit/common_test_Download.js index fad23071e39d..3310eef05a19 100644 --- a/toolkit/components/jsdownloads/test/unit/common_test_Download.js +++ b/toolkit/components/jsdownloads/test/unit/common_test_Download.js @@ -9,6 +9,9 @@ * the "copy" and "legacy" saver implementations. */ +/* import-globals-from head.js */ +/* global gUseLegacySaver */ + "use strict"; // Globals diff --git a/toolkit/components/jsdownloads/test/unit/head.js b/toolkit/components/jsdownloads/test/unit/head.js index b9d5c0c60575..42fa2bb96f87 100644 --- a/toolkit/components/jsdownloads/test/unit/head.js +++ b/toolkit/components/jsdownloads/test/unit/head.js @@ -48,6 +48,7 @@ XPCOMUtils.defineLazyServiceGetter(this, "gExternalHelperAppService", "@mozilla.org/uriloader/external-helper-app-service;1", Ci.nsIExternalHelperAppService); +/* global DownloadIntegration */ Integration.downloads.defineModuleGetter(this, "DownloadIntegration", "resource://gre/modules/DownloadIntegration.jsm"); diff --git a/toolkit/components/mozintl/test/.eslintrc.js b/toolkit/components/mozintl/test/.eslintrc.js new file mode 100644 index 000000000000..fee088c17903 --- /dev/null +++ b/toolkit/components/mozintl/test/.eslintrc.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = { + "extends": [ + "../../../../testing/xpcshell/xpcshell.eslintrc.js" + ] +}; diff --git a/toolkit/components/places/nsPlacesExpiration.js b/toolkit/components/places/nsPlacesExpiration.js index 4b05f8b73359..44e945819d3a 100644 --- a/toolkit/components/places/nsPlacesExpiration.js +++ b/toolkit/components/places/nsPlacesExpiration.js @@ -833,7 +833,7 @@ nsPlacesExpiration.prototype = { memSizeBytes = Services.sysinfo.getProperty("memsize"); } catch (ex) {} if (memSizeBytes <= 0) { - memsize = MEMSIZE_FALLBACK_BYTES; + memSizeBytes = MEMSIZE_FALLBACK_BYTES; } let diskAvailableBytes = DISKSIZE_FALLBACK_BYTES; diff --git a/toolkit/components/places/tests/bookmarks/head_bookmarks.js b/toolkit/components/places/tests/bookmarks/head_bookmarks.js index 842a66b313c1..042f75a7238f 100644 --- a/toolkit/components/places/tests/bookmarks/head_bookmarks.js +++ b/toolkit/components/places/tests/bookmarks/head_bookmarks.js @@ -12,6 +12,7 @@ Cu.import("resource://gre/modules/Services.jsm"); // Import common head. { + /* import-globals-from ../head_common.js */ let commonFile = do_get_file("../head_common.js", false); let uri = Services.io.newFileURI(commonFile); Services.scriptloader.loadSubScript(uri.spec, this); diff --git a/toolkit/components/places/tests/bookmarks/test_1016953-renaming-uncompressed.js b/toolkit/components/places/tests/bookmarks/test_1016953-renaming-uncompressed.js index b6982987b520..610bc6bbebea 100644 --- a/toolkit/components/places/tests/bookmarks/test_1016953-renaming-uncompressed.js +++ b/toolkit/components/places/tests/bookmarks/test_1016953-renaming-uncompressed.js @@ -58,7 +58,7 @@ add_task(function* test_same_date_diff_hash() { let backupFile = OS.Path.join(backupFolder, filename); yield OS.File.move(tempPath, backupFile); yield PlacesBackups.create(); // Force compressed backup - mostRecentBackupFile = yield PlacesBackups.getMostRecentBackup(); + let mostRecentBackupFile = yield PlacesBackups.getMostRecentBackup(); // Decode lz4 compressed file to json and check if json is valid let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"]. diff --git a/toolkit/components/places/tests/bookmarks/test_818584-discard-duplicate-backups.js b/toolkit/components/places/tests/bookmarks/test_818584-discard-duplicate-backups.js index c88323478f3d..68b3b9b95844 100644 --- a/toolkit/components/places/tests/bookmarks/test_818584-discard-duplicate-backups.js +++ b/toolkit/components/places/tests/bookmarks/test_818584-discard-duplicate-backups.js @@ -46,7 +46,7 @@ add_task(function*() { // backup will replace the existing one. yield PlacesBackups.create(undefined, true); do_check_eq(backupFiles.length, 1); - recentBackup = yield PlacesBackups.getMostRecentBackup(); + let recentBackup = yield PlacesBackups.getMostRecentBackup(); do_check_neq(recentBackup, OS.Path.join(backupFolder, oldBackupName)); matches = OS.Path.basename(recentBackup).match(PlacesBackups.filenamesRegex); do_check_eq(matches[1], PlacesBackups.toISODateString(new Date())); diff --git a/toolkit/components/places/tests/bookmarks/test_818593-store-backup-metadata.js b/toolkit/components/places/tests/bookmarks/test_818593-store-backup-metadata.js index 4ea07fb3935e..28713b615fb6 100644 --- a/toolkit/components/places/tests/bookmarks/test_818593-store-backup-metadata.js +++ b/toolkit/components/places/tests/bookmarks/test_818593-store-backup-metadata.js @@ -43,7 +43,7 @@ add_task(function* test_saveBookmarksToJSONFile_and_create() yield PlacesBackups.create(); do_check_eq((yield PlacesBackups.getBackupFiles()).length, 1); - mostRecentBackupFile = yield PlacesBackups.getMostRecentBackup(); + let mostRecentBackupFile = yield PlacesBackups.getMostRecentBackup(); do_check_neq(mostRecentBackupFile, null); matches = OS.Path.basename(recentBackup).match(PlacesBackups.filenamesRegex); do_check_eq(matches[2], nodeCount); @@ -54,4 +54,3 @@ add_task(function* test_saveBookmarksToJSONFile_and_create() yield PlacesBackups.create(0); PlacesUtils.bookmarks.removeItem(bookmarkId); }); - diff --git a/toolkit/components/places/tests/bookmarks/test_bookmarks.js b/toolkit/components/places/tests/bookmarks/test_bookmarks.js index bc4734affc95..d8b51716489a 100644 --- a/toolkit/components/places/tests/bookmarks/test_bookmarks.js +++ b/toolkit/components/places/tests/bookmarks/test_bookmarks.js @@ -357,7 +357,7 @@ add_task(function* test_bookmarks() { bs.removeFolderChildren(tmpFolder); // 4) confirm that folder has 0 children try { - result = hs.executeQuery(query, options); + let result = hs.executeQuery(query, options); let rootNode = result.root; rootNode.containerOpen = true; do_check_eq(rootNode.childCount, 0); diff --git a/toolkit/components/places/tests/bookmarks/test_bookmarks_eraseEverything.js b/toolkit/components/places/tests/bookmarks/test_bookmarks_eraseEverything.js index e8414359b5a4..e298eb829c83 100644 --- a/toolkit/components/places/tests/bookmarks/test_bookmarks_eraseEverything.js +++ b/toolkit/components/places/tests/bookmarks/test_bookmarks_eraseEverything.js @@ -68,7 +68,7 @@ add_task(function* test_eraseEverything() { // Bug 1306445 will eventually remove the mobile root anno. Assert.equal(annoAttrs.length, 1); Assert.equal(annoAttrs[0].getResultByName("name"), PlacesUtils.MOBILE_ROOT_ANNO); - let annos = rows = yield conn.execute(`SELECT item_id, anno_attribute_id FROM moz_items_annos`); + let annos = yield conn.execute(`SELECT item_id, anno_attribute_id FROM moz_items_annos`); Assert.equal(annos.length, 1); Assert.equal(annos[0].getResultByName("item_id"), PlacesUtils.mobileFolderId); Assert.equal(annos[0].getResultByName("anno_attribute_id"), annoAttrs[0].getResultByName("id")); diff --git a/toolkit/components/places/tests/bookmarks/test_bookmarks_remove.js b/toolkit/components/places/tests/bookmarks/test_bookmarks_remove.js index 19085a2823ca..3d3dc8682d33 100644 --- a/toolkit/components/places/tests/bookmarks/test_bookmarks_remove.js +++ b/toolkit/components/places/tests/bookmarks/test_bookmarks_remove.js @@ -103,7 +103,7 @@ add_task(function* remove_bookmark_orphans() { // Bug 1306445 will eventually remove the mobile root anno. Assert.equal(annoAttrs.length, 1); Assert.equal(annoAttrs[0].getResultByName("name"), PlacesUtils.MOBILE_ROOT_ANNO); - let annos = rows = yield conn.execute(`SELECT item_id, anno_attribute_id FROM moz_items_annos`); + let annos = yield conn.execute(`SELECT item_id, anno_attribute_id FROM moz_items_annos`); Assert.equal(annos.length, 1); Assert.equal(annos[0].getResultByName("item_id"), PlacesUtils.mobileFolderId); Assert.equal(annos[0].getResultByName("anno_attribute_id"), annoAttrs[0].getResultByName("id")); diff --git a/toolkit/components/places/tests/expiration/head_expiration.js b/toolkit/components/places/tests/expiration/head_expiration.js index 2be4af307ce4..3eb7bf0477bd 100644 --- a/toolkit/components/places/tests/expiration/head_expiration.js +++ b/toolkit/components/places/tests/expiration/head_expiration.js @@ -13,6 +13,7 @@ Cu.import("resource://gre/modules/Services.jsm"); // Import common head. { + /* import-globals-from ../head_common.js */ let commonFile = do_get_file("../head_common.js", false); let uri = Services.io.newFileURI(commonFile); Services.scriptloader.loadSubScript(uri.spec, this); diff --git a/toolkit/components/places/tests/expiration/test_notifications_onDeleteURI.js b/toolkit/components/places/tests/expiration/test_notifications_onDeleteURI.js index d51f3b4f37fb..0a32e9caab7f 100644 --- a/toolkit/components/places/tests/expiration/test_notifications_onDeleteURI.js +++ b/toolkit/components/places/tests/expiration/test_notifications_onDeleteURI.js @@ -77,7 +77,7 @@ add_task(function* test_notifications_onDeleteURI() { } // Observe history. - historyObserver = { + let historyObserver = { onBeginUpdateBatch: function PEX_onBeginUpdateBatch() {}, onEndUpdateBatch: function PEX_onEndUpdateBatch() {}, onClearHistory: function() {}, diff --git a/toolkit/components/places/tests/expiration/test_notifications_onDeleteVisits.js b/toolkit/components/places/tests/expiration/test_notifications_onDeleteVisits.js index 30065a126ef6..af70e3f22da0 100644 --- a/toolkit/components/places/tests/expiration/test_notifications_onDeleteVisits.js +++ b/toolkit/components/places/tests/expiration/test_notifications_onDeleteVisits.js @@ -102,7 +102,7 @@ add_task(function* test_notifications_onDeleteVisits() { } // Observe history. - historyObserver = { + let historyObserver = { onBeginUpdateBatch: function PEX_onBeginUpdateBatch() {}, onEndUpdateBatch: function PEX_onEndUpdateBatch() {}, onClearHistory: function() {}, diff --git a/toolkit/components/places/tests/favicons/head_favicons.js b/toolkit/components/places/tests/favicons/head_favicons.js index ed919482df5a..f8c3bf9e0142 100644 --- a/toolkit/components/places/tests/favicons/head_favicons.js +++ b/toolkit/components/places/tests/favicons/head_favicons.js @@ -12,6 +12,7 @@ Cu.import("resource://gre/modules/Services.jsm"); // Import common head. { + /* import-globals-from ../head_common.js */ let commonFile = do_get_file("../head_common.js", false); let uri = Services.io.newFileURI(commonFile); Services.scriptloader.loadSubScript(uri.spec, this); diff --git a/toolkit/components/places/tests/history/head_history.js b/toolkit/components/places/tests/history/head_history.js index 870802dc1da5..3f51c9eaa60c 100644 --- a/toolkit/components/places/tests/history/head_history.js +++ b/toolkit/components/places/tests/history/head_history.js @@ -13,6 +13,7 @@ Cu.import("resource://gre/modules/Services.jsm"); // Import common head. { + /* import-globals-from ../head_common.js */ let commonFile = do_get_file("../head_common.js", false); let uri = Services.io.newFileURI(commonFile); Services.scriptloader.loadSubScript(uri.spec, this); diff --git a/toolkit/components/places/tests/migration/head_migration.js b/toolkit/components/places/tests/migration/head_migration.js index 1ebecd4c0fb8..83d0bf96293c 100644 --- a/toolkit/components/places/tests/migration/head_migration.js +++ b/toolkit/components/places/tests/migration/head_migration.js @@ -9,6 +9,7 @@ Cu.import("resource://gre/modules/Services.jsm"); // Import common head. { + /* import-globals-from ../head_common.js */ let commonFile = do_get_file("../head_common.js", false); let uri = Services.io.newFileURI(commonFile); Services.scriptloader.loadSubScript(uri.spec, this); diff --git a/toolkit/components/places/tests/queries/head_queries.js b/toolkit/components/places/tests/queries/head_queries.js index 7d6bc833223f..a3187f509673 100644 --- a/toolkit/components/places/tests/queries/head_queries.js +++ b/toolkit/components/places/tests/queries/head_queries.js @@ -13,6 +13,7 @@ Cu.import("resource://gre/modules/Services.jsm"); // Import common head. { + /* import-globals-from ../head_common.js */ let commonFile = do_get_file("../head_common.js", false); let uri = Services.io.newFileURI(commonFile); Services.scriptloader.loadSubScript(uri.spec, this); diff --git a/toolkit/components/places/tests/unifiedcomplete/head_autocomplete.js b/toolkit/components/places/tests/unifiedcomplete/head_autocomplete.js index ff849a4ea9ef..36955f3c8cff 100644 --- a/toolkit/components/places/tests/unifiedcomplete/head_autocomplete.js +++ b/toolkit/components/places/tests/unifiedcomplete/head_autocomplete.js @@ -14,6 +14,7 @@ Cu.import("resource://testing-common/httpd.js"); // Import common head. { + /* import-globals-from ../head_common.js */ let commonFile = do_get_file("../head_common.js", false); let uri = Services.io.newFileURI(commonFile); Services.scriptloader.loadSubScript(uri.spec, this); diff --git a/toolkit/components/places/tests/unifiedcomplete/test_autocomplete_functional.js b/toolkit/components/places/tests/unifiedcomplete/test_autocomplete_functional.js index cd2dfdb17a26..bbd39c1b8372 100644 --- a/toolkit/components/places/tests/unifiedcomplete/test_autocomplete_functional.js +++ b/toolkit/components/places/tests/unifiedcomplete/test_autocomplete_functional.js @@ -153,19 +153,19 @@ add_task(function* test_complete_fragment() { add_task(function* test_autocomplete_enabled_pref() { Services.prefs.setBoolPref(PREF_AUTOCOMPLETE_ENABLED, false); let types = ["history", "bookmark", "openpage"]; - for (type of types) { + for (let type of types) { do_check_eq(Services.prefs.getBoolPref("browser.urlbar.suggest." + type), false, "suggest." + type + "pref should be false"); } Services.prefs.setBoolPref(PREF_AUTOCOMPLETE_ENABLED, true); - for (type of types) { + for (let type of types) { do_check_eq(Services.prefs.getBoolPref("browser.urlbar.suggest." + type), true, "suggest." + type + "pref should be true"); } // Clear prefs. Services.prefs.clearUserPref(PREF_AUTOCOMPLETE_ENABLED); - for (type of types) { + for (let type of types) { Services.prefs.clearUserPref("browser.urlbar.suggest." + type); } }); diff --git a/toolkit/components/places/tests/unifiedcomplete/test_search_engine_current.js b/toolkit/components/places/tests/unifiedcomplete/test_search_engine_current.js index b41d9884bd81..767acb609501 100644 --- a/toolkit/components/places/tests/unifiedcomplete/test_search_engine_current.js +++ b/toolkit/components/places/tests/unifiedcomplete/test_search_engine_current.js @@ -32,7 +32,7 @@ add_task(function*() { do_print("search engine, after current engine has changed"); Services.search.addEngineWithDetails("MozSearch2", "", "", "", "GET", "http://s.example.com/search2"); - engine = Services.search.getEngineByName("MozSearch2"); + let engine = Services.search.getEngineByName("MozSearch2"); notEqual(Services.search.currentEngine, engine, "New engine shouldn't be the current engine yet"); Services.search.currentEngine = engine; yield check_autocomplete({ diff --git a/toolkit/components/places/tests/unit/head_bookmarks.js b/toolkit/components/places/tests/unit/head_bookmarks.js index 842a66b313c1..042f75a7238f 100644 --- a/toolkit/components/places/tests/unit/head_bookmarks.js +++ b/toolkit/components/places/tests/unit/head_bookmarks.js @@ -12,6 +12,7 @@ Cu.import("resource://gre/modules/Services.jsm"); // Import common head. { + /* import-globals-from ../head_common.js */ let commonFile = do_get_file("../head_common.js", false); let uri = Services.io.newFileURI(commonFile); Services.scriptloader.loadSubScript(uri.spec, this); diff --git a/toolkit/components/places/tests/unit/test_415757.js b/toolkit/components/places/tests/unit/test_415757.js index afd396183afa..16bd888e6313 100644 --- a/toolkit/components/places/tests/unit/test_415757.js +++ b/toolkit/components/places/tests/unit/test_415757.js @@ -86,7 +86,7 @@ add_task(function* test_execute() // check that annotation on the removed item does not exists try { - PlacesUtils.annotations.getPageAnnotation(testAnnoDeletedURI, testAnnoName); + PlacesUtils.annotations.getPageAnnotation(testAnnoDeletedURI, testAnnoDeletedName); do_throw("fetching page-annotation that doesn't exist, should've thrown"); } catch (ex) {} diff --git a/toolkit/components/places/tests/unit/test_async_transactions.js b/toolkit/components/places/tests/unit/test_async_transactions.js index a05ff82614c8..b1a131364f2f 100644 --- a/toolkit/components/places/tests/unit/test_async_transactions.js +++ b/toolkit/components/places/tests/unit/test_async_transactions.js @@ -1471,7 +1471,7 @@ add_task(function* test_livemark_txns() { add_task(function* test_copy() { function* duplicate_and_test(aOriginalGuid) { let txn = PT.Copy({ guid: aOriginalGuid, newParentGuid: rootGuid }); - yield duplicateGuid = yield txn.transact(); + let duplicateGuid = yield txn.transact(); let originalInfo = yield PlacesUtils.promiseBookmarksTree(aOriginalGuid); let duplicateInfo = yield PlacesUtils.promiseBookmarksTree(duplicateGuid); yield ensureEqualBookmarksTrees(originalInfo, duplicateInfo, false); diff --git a/toolkit/components/places/tests/unit/test_bookmarks_html.js b/toolkit/components/places/tests/unit/test_bookmarks_html.js index f5831b3a1b89..c9876a133607 100644 --- a/toolkit/components/places/tests/unit/test_bookmarks_html.js +++ b/toolkit/components/places/tests/unit/test_bookmarks_html.js @@ -304,7 +304,7 @@ function* checkItem(aExpected, aNode) let id = aNode.itemId; return Task.spawn(function* () { - for (prop in aExpected) { + for (let prop in aExpected) { switch (prop) { case "type": do_check_eq(aNode.type, aExpected.type); diff --git a/toolkit/components/places/tests/unit/test_bookmarks_json.js b/toolkit/components/places/tests/unit/test_bookmarks_json.js index 98a623c6ca75..164f43d06eeb 100644 --- a/toolkit/components/places/tests/unit/test_bookmarks_json.js +++ b/toolkit/components/places/tests/unit/test_bookmarks_json.js @@ -158,7 +158,7 @@ function* checkItem(aExpected, aNode) { let id = aNode.itemId; return Task.spawn(function* () { - for (prop in aExpected) { + for (let prop in aExpected) { switch (prop) { case "type": do_check_eq(aNode.type, aExpected.type); diff --git a/toolkit/components/places/tests/unit/test_bookmarks_restore_notification.js b/toolkit/components/places/tests/unit/test_bookmarks_restore_notification.js index 97b5a4e24ff4..76c2c9355a55 100644 --- a/toolkit/components/places/tests/unit/test_bookmarks_restore_notification.js +++ b/toolkit/components/places/tests/unit/test_bookmarks_restore_notification.js @@ -116,7 +116,7 @@ function* checkObservers(expectPromises, expectedData) { // Make sure folder ID is what is expected. For importing HTML into a // folder, this will be an integer, otherwise null. if (resultSubject) { - Assert.equal(aSubject.QueryInterface(Ci.nsISupportsPRInt64).data, + Assert.equal(resultSubject.QueryInterface(Ci.nsISupportsPRInt64).data, expectedData.folderId); } else { Assert.equal(expectedData.folderId, null); diff --git a/toolkit/components/places/tests/unit/test_history_clear.js b/toolkit/components/places/tests/unit/test_history_clear.js index 56d34994f7ab..e493a8298c23 100644 --- a/toolkit/components/places/tests/unit/test_history_clear.js +++ b/toolkit/components/places/tests/unit/test_history_clear.js @@ -106,7 +106,7 @@ add_task(function* test_history_clear() // Check that frecency for not cleared items (bookmarks) has been converted // to -1. - stmt = mDBConn.createStatement( + let stmt = mDBConn.createStatement( "SELECT h.id FROM moz_places h WHERE h.frecency > 0 "); do_check_false(stmt.executeStep()); stmt.finalize(); diff --git a/toolkit/components/places/tests/unit/test_preventive_maintenance.js b/toolkit/components/places/tests/unit/test_preventive_maintenance.js index f406423989eb..9e9295e3eefb 100644 --- a/toolkit/components/places/tests/unit/test_preventive_maintenance.js +++ b/toolkit/components/places/tests/unit/test_preventive_maintenance.js @@ -834,7 +834,7 @@ tests.push({ // Add a place to ensure place_id = 1 is valid this._placeId = addPlace(); // Add a valid visit and an invalid one - stmt = mDBConn.createStatement("INSERT INTO moz_historyvisits(place_id) VALUES (:place_id)"); + let stmt = mDBConn.createStatement("INSERT INTO moz_historyvisits(place_id) VALUES (:place_id)"); stmt.params["place_id"] = this._placeId; stmt.execute(); stmt.reset(); @@ -960,7 +960,7 @@ tests.push({ // Insert a bookmark this._bookmarkId = addBookmark(this._placeId); // Add a used attribute. - stmt = mDBConn.createStatement("INSERT INTO moz_anno_attributes (name) VALUES (:anno)"); + let stmt = mDBConn.createStatement("INSERT INTO moz_anno_attributes (name) VALUES (:anno)"); stmt.params['anno'] = this._usedItemAttribute; stmt.execute(); stmt.finalize(); diff --git a/toolkit/components/places/tests/unit/test_sync_utils.js b/toolkit/components/places/tests/unit/test_sync_utils.js index 58f6b9dbc9db..df20cceae829 100644 --- a/toolkit/components/places/tests/unit/test_sync_utils.js +++ b/toolkit/components/places/tests/unit/test_sync_utils.js @@ -257,11 +257,11 @@ add_task(function* test_dedupe() { url: "http://getthunderbird.com", }); - yield rejects( + yield Assert.rejects( PlacesSyncUtils.bookmarks.dedupe(makeGuid(), makeGuid(), makeGuid()), "Should reject attempts to de-dupe nonexistent items" ); - yield rejects(PlacesSyncUtils.bookmarks.dedupe("menu", makeGuid(), "places"), + yield Assert.rejects(PlacesSyncUtils.bookmarks.dedupe("menu", makeGuid(), "places"), "Should reject attempts to de-dupe local roots"); do_print("De-dupe with same remote parent"); @@ -282,7 +282,7 @@ add_task(function* test_dedupe() { ok(!(yield PlacesUtils.bookmarks.fetch(mozBmk.syncId)), "Bookmark with old local sync ID should not exist"); - yield rejects(PlacesUtils.promiseItemId(mozBmk.syncId), + yield Assert.rejects(PlacesUtils.promiseItemId(mozBmk.syncId), "Should invalidate GUID cache entry for old local sync ID"); let newMozBmk = yield PlacesUtils.bookmarks.fetch(newRemoteSyncId); @@ -701,7 +701,7 @@ add_task(function* test_update_move_root() { } do_print("Try reparenting root"); - yield rejects(PlacesSyncUtils.bookmarks.update({ + yield Assert.rejects(PlacesSyncUtils.bookmarks.update({ syncId: "menu", parentSyncId: "toolbar", })); @@ -871,7 +871,7 @@ add_task(function* test_update_livemark() { // Since we're reinserting, we need to pass all properties required // for a new livemark. `update` won't merge the old and new ones. - yield rejects(PlacesSyncUtils.bookmarks.update({ + yield Assert.rejects(PlacesSyncUtils.bookmarks.update({ syncId: livemark.guid, feed: site + "/feed/2", }), "Reinserting livemark with changed feed URL requires full record"); @@ -897,7 +897,7 @@ add_task(function* test_update_livemark() { ok(livemark.feedURI.equals(feedURI), "Livemark feed URI should match"); ok(!livemark.siteURI, "Livemark should not have site URI"); - yield rejects(PlacesSyncUtils.bookmarks.update({ + yield Assert.rejects(PlacesSyncUtils.bookmarks.update({ syncId: livemark.guid, site, }), "Reinserting livemark with new site URL requires full record"); @@ -928,7 +928,7 @@ add_task(function* test_update_livemark() { index: PlacesUtils.bookmarks.DEFAULT_INDEX, }); - yield rejects(PlacesSyncUtils.bookmarks.update({ + yield Assert.rejects(PlacesSyncUtils.bookmarks.update({ syncId: livemark.guid, site: null, }), "Reinserting livemark witout site URL requires full record"); @@ -956,7 +956,7 @@ add_task(function* test_update_livemark() { index: PlacesUtils.bookmarks.DEFAULT_INDEX, }); - yield rejects(PlacesSyncUtils.bookmarks.update({ + yield Assert.rejects(PlacesSyncUtils.bookmarks.update({ syncId: livemark.guid, site: site + "/new", }), "Reinserting livemark with changed site URL requires full record"); diff --git a/toolkit/components/printing/content/printPreviewBindings.xml b/toolkit/components/printing/content/printPreviewBindings.xml index ee699de24801..6b279d5cca42 100644 --- a/toolkit/components/printing/content/printPreviewBindings.xml +++ b/toolkit/components/printing/content/printPreviewBindings.xml @@ -15,7 +15,7 @@ xmlns="http://www.mozilla.org/xbl" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> - @@ -52,7 +52,7 @@ - @@ -68,7 +68,7 @@ - @@ -81,7 +81,7 @@ accesskey="&portrait.accesskey;" type="radio" group="orient" class="toolbar-portrait-page tabbable" oncommand="parentNode.parentNode.orient('portrait');"/> - @@ -172,6 +172,7 @@ Mozilla Bug 619644
   
+  
   
   
         
         
 
@@ -10,7 +10,7 @@