Bug 1411368 - Automatically fix no-multi-spaces issues raised when using ESLint 4. r=mossop

MozReview-Commit-ID: H5YVp3rnzGo

--HG--
extra : rebase_source : 5b45b6c0df834131812d094e975047eaad374e06
This commit is contained in:
Mark Banner 2017-10-26 11:47:01 +01:00
Родитель 4f0959f751
Коммит 4de6bf22b1
139 изменённых файлов: 384 добавлений и 378 удалений

Просмотреть файл

@ -13,13 +13,13 @@ this.EXPORTED_SYMBOLS = ["TraversalRules", "TraversalHelper"]; // jshint ignore:
Cu.import("resource://gre/modules/accessibility/Utils.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Roles", // jshint ignore:line
XPCOMUtils.defineLazyModuleGetter(this, "Roles", // jshint ignore:line
"resource://gre/modules/accessibility/Constants.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Filters", // jshint ignore:line
XPCOMUtils.defineLazyModuleGetter(this, "Filters", // jshint ignore:line
"resource://gre/modules/accessibility/Constants.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "States", // jshint ignore:line
XPCOMUtils.defineLazyModuleGetter(this, "States", // jshint ignore:line
"resource://gre/modules/accessibility/Constants.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Prefilters", // jshint ignore:line
XPCOMUtils.defineLazyModuleGetter(this, "Prefilters", // jshint ignore:line
"resource://gre/modules/accessibility/Constants.jsm");
var gSkipEmptyImages = new PrefCache("accessibility.accessfu.skip_empty_images");

Просмотреть файл

@ -63,7 +63,7 @@
AccessFuTest.addFunc(settingsStart);
AccessFuTest.addFunc(settingsStop);
AccessFuTest.waitForExplicitFinish();
AccessFuTest.runTests(); // Will call SimpleTest.finish();
AccessFuTest.runTests(); // Will call SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();

Просмотреть файл

@ -70,7 +70,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=420863
}
];
testActions(actionsArray); // will call SimpleTest.finish()
testActions(actionsArray); // will call SimpleTest.finish()
}
SimpleTest.waitForExplicitFinish();

Просмотреть файл

@ -887,7 +887,7 @@ BrowserPageActions.sendToDevice = {
bodyNode.setAttribute("state", "notready");
// Force a background Sync
Services.tm.dispatchToMainThread(async () => {
await Weave.Service.sync([]); // [] = clients engine only
await Weave.Service.sync([]); // [] = clients engine only
// There's no way Sync is still syncing at this point, but we check
// anyway to avoid infinite looping.
if (!window.closed && !gSync.syncConfiguredAndLoading) {

Просмотреть файл

@ -2385,7 +2385,7 @@ function BrowserCloseTabOrWindow() {
function BrowserTryToCloseWindow() {
if (WindowIsClosing())
window.close(); // WindowIsClosing does all the necessary checks
window.close(); // WindowIsClosing does all the necessary checks
}
function loadURI(uri, referrer, postData, allowThirdPartyFixup, referrerPolicy,
@ -4627,7 +4627,7 @@ var XULBrowserWindow = {
if (aWebProgress.isTopLevel) {
if ((location == "about:blank" && checkEmptyPageOrigin()) ||
location == "") { // Second condition is for new tabs, otherwise
location == "") { // Second condition is for new tabs, otherwise
// reload function is enabled until tab is refreshed.
this.reloadCommand.setAttribute("disabled", "true");
} else {
@ -8807,7 +8807,7 @@ var ToolbarIconColor = {
handleEvent(event) {
switch (event.type) {
case "activate": // falls through
case "activate": // falls through
case "deactivate":
this.inferFromText(event.type);
break;

Просмотреть файл

@ -189,7 +189,7 @@ nsContextMenu.prototype = {
this.linkProtocol = context.linkProtocol;
this.linkTextStr = context.linkTextStr;
this.linkURL = context.linkURL;
this.linkURI = this.getLinkURI(); // can't send; regenerate
this.linkURI = this.getLinkURI(); // can't send; regenerate
this.onAudio = context.onAudio;
this.onCanvas = context.onCanvas;

Просмотреть файл

@ -1020,7 +1020,7 @@ function setItemValue(id, value) {
}
function formatNumber(number) {
return (+number).toLocaleString(); // coerce number to a numeric value before calling toLocaleString()
return (+number).toLocaleString(); // coerce number to a numeric value before calling toLocaleString()
}
function formatDate(datestr, unknown) {

Просмотреть файл

@ -750,8 +750,8 @@ Sanitizer.getClearRange = function(ts) {
startDate = endDate - 14400000000; // 4*60*60*1000000
break;
case Sanitizer.TIMESPAN_TODAY :
var d = new Date(); // Start with today
d.setHours(0); // zero us back to midnight...
var d = new Date(); // Start with today
d.setHours(0); // zero us back to midnight...
d.setMinutes(0);
d.setSeconds(0);
startDate = d.valueOf() * 1000; // convert to epoch usec

Просмотреть файл

@ -115,7 +115,7 @@ function test_clicks(type, clicks) {
}
function test_TestEventListeners() {
let e = test_helper1; // easier to type this name
let e = test_helper1; // easier to type this name
// Swipe gesture animation events
e("MozSwipeGestureStart", 0, -0.7, 0);

Просмотреть файл

@ -63,7 +63,7 @@ function rightClickVideo(browser) {
utils.sendMouseEvent("contextmenu", left, top,
2, /* aButton */
1, /* aClickCount */
0 /* aModifiers */);
0 /* aModifiers */);
};
let mm = browser.messageManager;
mm.loadFrameScript("data:,(" + frame_script.toString() + ")();", true);

Просмотреть файл

@ -27,7 +27,7 @@ function clearAllImageCaches() {
var tools = Cc["@mozilla.org/image/tools;1"]
.getService(SpecialPowers.Ci.imgITools);
var imageCache = tools.getImgCacheForDocument(window.document);
imageCache.clearCache(true); // true=chrome
imageCache.clearCache(true); // true=chrome
imageCache.clearCache(false); // false=content
}

Просмотреть файл

@ -15,6 +15,6 @@ function startMiddleClickTestCase(aTestNumber) {
}
function test() {
requestLongerTimeout(10); // slowwww shutdown on e10s
requestLongerTimeout(10); // slowwww shutdown on e10s
startReferrerTest(startMiddleClickTestCase);
}

Просмотреть файл

@ -21,7 +21,7 @@ function test() {
SpecialPowers.pushPrefEnv(
{set: [["privacy.userContext.enabled", true]]},
function() {
requestLongerTimeout(10); // slowwww shutdown on e10s
requestLongerTimeout(10); // slowwww shutdown on e10s
startReferrerTest(startMiddleClickTestCase, { userContextId: 3 });
});
}

Просмотреть файл

@ -50,7 +50,7 @@ function test() {
SpecialPowers.pushPrefEnv(
{set: [["privacy.userContext.enabled", true]]},
function() {
requestLongerTimeout(10); // slowwww shutdown on e10s
requestLongerTimeout(10); // slowwww shutdown on e10s
startReferrerTest(startNewTabTestCase);
});
}

Просмотреть файл

@ -25,7 +25,7 @@ function test() {
SpecialPowers.pushPrefEnv(
{set: [["privacy.userContext.enabled", true]]},
function() {
requestLongerTimeout(10); // slowwww shutdown on e10s
requestLongerTimeout(10); // slowwww shutdown on e10s
startReferrerTest(startNewTabTestCase, { userContextId: 1 });
});
}

Просмотреть файл

@ -46,7 +46,7 @@ function test() {
SpecialPowers.pushPrefEnv(
{set: [["privacy.userContext.enabled", true]]},
function() {
requestLongerTimeout(10); // slowwww shutdown on e10s
requestLongerTimeout(10); // slowwww shutdown on e10s
startReferrerTest(startNewTabTestCase, { userContextId: 2 });
});
}

Просмотреть файл

@ -22,6 +22,6 @@ function startNewPrivateWindowTestCase(aTestNumber) {
}
function test() {
requestLongerTimeout(10); // slowwww shutdown on e10s
requestLongerTimeout(10); // slowwww shutdown on e10s
startReferrerTest(startNewPrivateWindowTestCase);
}

Просмотреть файл

@ -16,6 +16,6 @@ function startNewTabTestCase(aTestNumber) {
}
function test() {
requestLongerTimeout(10); // slowwww shutdown on e10s
requestLongerTimeout(10); // slowwww shutdown on e10s
startReferrerTest(startNewTabTestCase);
}

Просмотреть файл

@ -17,6 +17,6 @@ function startNewWindowTestCase(aTestNumber) {
}
function test() {
requestLongerTimeout(10); // slowwww shutdown on e10s
requestLongerTimeout(10); // slowwww shutdown on e10s
startReferrerTest(startNewWindowTestCase);
}

Просмотреть файл

@ -26,7 +26,7 @@ function test() {
SpecialPowers.pushPrefEnv(
{set: [["privacy.userContext.enabled", true]]},
function() {
requestLongerTimeout(10); // slowwww shutdown on e10s
requestLongerTimeout(10); // slowwww shutdown on e10s
startReferrerTest(startNewWindowTestCase, { userContextId: 1 });
});
}

Просмотреть файл

@ -15,6 +15,6 @@ function startSimpleClickTestCase(aTestNumber) {
}
function test() {
requestLongerTimeout(10); // slowwww shutdown on e10s
requestLongerTimeout(10); // slowwww shutdown on e10s
startReferrerTest(startSimpleClickTestCase);
}

Просмотреть файл

@ -218,7 +218,7 @@ var gMenuBuilder = {
element.setAttribute("disabled", "true");
}
element.addEventListener("command", event => { // eslint-disable-line mozilla/balanced-listeners
element.addEventListener("command", event => { // eslint-disable-line mozilla/balanced-listeners
if (event.target !== event.currentTarget) {
return;
}

Просмотреть файл

@ -849,8 +849,8 @@ this.tabs = class extends ExtensionAPI {
// OK clicked (retval == 0) or replace confirmed (retval == 2)
try {
let fstream = Cc["@mozilla.org/network/file-output-stream;1"].createInstance(Ci.nsIFileOutputStream);
fstream.init(picker.file, 0x2A, 0x1B6, 0); // write|create|truncate, file permissions rw-rw-rw- = 0666 = 0x1B6
fstream.close(); // unlock file
fstream.init(picker.file, 0x2A, 0x1B6, 0); // write|create|truncate, file permissions rw-rw-rw- = 0666 = 0x1B6
fstream.close(); // unlock file
} catch (e) {
resolve(retval == 0 ? "not_saved" : "not_replaced");
return;

Просмотреть файл

@ -53,7 +53,7 @@ add_task(async function redirector_ignores_override() {
Services.scriptSecurityManager.getSystemPrincipal(),
"nodePrincipal should match systemPrincipal");
});
}); // jshint ignore:line
}); // jshint ignore:line
}
});
@ -75,7 +75,7 @@ add_task(async function override_loads_in_browser() {
Assert.ok(aboutNewTabService.overridden, "url has been overridden");
// simulate a newtab open as a user would
BrowserOpenTab(); // jshint ignore:line
BrowserOpenTab(); // jshint ignore:line
let browser = gBrowser.selectedBrowser;
await BrowserTestUtils.browserLoaded(browser);
@ -83,7 +83,7 @@ add_task(async function override_loads_in_browser() {
await ContentTask.spawn(browser, {url: overrideURL}, async function(args) {
Assert.equal(content.location.href, args.url.trim(), "Got right URL");
Assert.equal(content.document.location.href, args.url.trim(), "Got right URL");
}); // jshint ignore:line
}); // jshint ignore:line
await BrowserTestUtils.removeTab(gBrowser.selectedTab);
}
});
@ -107,7 +107,7 @@ add_task(async function override_blank_loads_in_browser() {
Assert.ok(aboutNewTabService.overridden, "url has been overridden");
// simulate a newtab open as a user would
BrowserOpenTab(); // jshint ignore:line
BrowserOpenTab(); // jshint ignore:line
let browser = gBrowser.selectedBrowser;
await BrowserTestUtils.browserLoaded(browser);
@ -115,13 +115,13 @@ add_task(async function override_blank_loads_in_browser() {
await ContentTask.spawn(browser, {}, async function() {
Assert.equal(content.location.href, "about:blank", "Got right URL");
Assert.equal(content.document.location.href, "about:blank", "Got right URL");
}); // jshint ignore:line
}); // jshint ignore:line
await BrowserTestUtils.removeTab(gBrowser.selectedTab);
}
});
function nextChangeNotificationPromise(aNewURL, testMessage) {
return TestUtils.topicObserved("newtab-url-changed", function observer(aSubject, aData) { // jshint unused:false
return TestUtils.topicObserved("newtab-url-changed", function observer(aSubject, aData) { // jshint unused:false
Assert.equal(aData, aNewURL, testMessage);
return true;
});

Просмотреть файл

@ -26,7 +26,7 @@ add_task(async function open_newtab() {
* the browser UI to access overriding URLs, for istance by click on the "+" button in the tab
* bar, or by using the new tab shortcut key.
*/
BrowserOpenTab(); // jshint ignore:line
BrowserOpenTab(); // jshint ignore:line
let browser = gBrowser.selectedBrowser;
await BrowserTestUtils.browserLoaded(browser);
@ -43,7 +43,7 @@ add_task(async function open_newtab() {
});
function nextChangeNotificationPromise(aNewURL, testMessage) {
return TestUtils.topicObserved("newtab-url-changed", function observer(aSubject, aData) { // jshint unused:false
return TestUtils.topicObserved("newtab-url-changed", function observer(aSubject, aData) { // jshint unused:false
Assert.equal(aData, aNewURL, testMessage);
return true;
});

Просмотреть файл

@ -177,7 +177,7 @@ add_task(async function test_updates() {
function nextChangeNotificationPromise(aNewURL, testMessage) {
return new Promise(resolve => {
Services.obs.addObserver(function observer(aSubject, aTopic, aData) { // jshint unused:false
Services.obs.addObserver(function observer(aSubject, aTopic, aData) { // jshint unused:false
Services.obs.removeObserver(observer, aTopic);
Assert.equal(aData, aNewURL, testMessage);
resolve();
@ -187,7 +187,7 @@ function nextChangeNotificationPromise(aNewURL, testMessage) {
function setBoolPrefAndWaitForChange(pref, value, testMessage) {
return new Promise(resolve => {
Services.obs.addObserver(function observer(aSubject, aTopic, aData) { // jshint unused:false
Services.obs.addObserver(function observer(aSubject, aTopic, aData) { // jshint unused:false
Services.obs.removeObserver(observer, aTopic);
Assert.equal(aData, aboutNewTabService.newTabURL, testMessage);
resolve();

Просмотреть файл

@ -686,6 +686,7 @@ BrowserGlue.prototype = {
let buildID = Services.appinfo.appBuildID;
let today = new Date().getTime();
/* eslint-disable no-multi-spaces */
let buildDate = new Date(buildID.slice(0, 4), // year
buildID.slice(4, 6) - 1, // months are zero-based.
buildID.slice(6, 8), // day
@ -693,6 +694,7 @@ BrowserGlue.prototype = {
buildID.slice(10, 12), // min
buildID.slice(12, 14)) // ms
.getTime();
/* eslint-enable no-multi-spaces */
const millisecondsIn24Hours = 86400000;
let acceptableAge = Services.prefs.getIntPref("app.update.checkInstallTime.days") * millisecondsIn24Hours;

Просмотреть файл

@ -32,7 +32,7 @@ function clearAllImageCaches() {
let tools = SpecialPowers.Cc["@mozilla.org/image/tools;1"]
.getService(SpecialPowers.Ci.imgITools);
let imageCache = tools.getImgCacheForDocument(window.document);
imageCache.clearCache(true); // true=chrome
imageCache.clearCache(true); // true=chrome
imageCache.clearCache(false); // false=content
}

Просмотреть файл

@ -33,7 +33,7 @@ function clearAllImageCaches() {
let tools = SpecialPowers.Cc["@mozilla.org/image/tools;1"]
.getService(SpecialPowers.Ci.imgITools);
let imageCache = tools.getImgCacheForDocument(window.document);
imageCache.clearCache(true); // true=chrome
imageCache.clearCache(true); // true=chrome
imageCache.clearCache(false); // false=content
}

Просмотреть файл

@ -33,7 +33,7 @@ function clearAllImageCaches() {
var tools = SpecialPowers.Cc["@mozilla.org/image/tools;1"]
.getService(SpecialPowers.Ci.imgITools);
var imageCache = tools.getImgCacheForDocument(window.document);
imageCache.clearCache(true); // true=chrome
imageCache.clearCache(true); // true=chrome
imageCache.clearCache(false); // false=content
}

Просмотреть файл

@ -1865,7 +1865,7 @@ PlacesToolbar.prototype = {
*/
function PlacesMenu(aPopupShowingEvent, aPlace, aOptions) {
this._rootElt = aPopupShowingEvent.target; // <menupopup>
this._viewElt = this._rootElt.parentNode; // <menu>
this._viewElt = this._rootElt.parentNode; // <menu>
this._viewElt._placesView = this;
this._addEventListeners(this._rootElt, ["popupshowing", "popuphidden"], true);
this._addEventListeners(window, ["unload"], false);

Просмотреть файл

@ -1249,11 +1249,11 @@ var gMainPane = {
var autoPref = document.getElementById("app.update.auto");
var radiogroup = document.getElementById("updateRadioGroup");
if (!enabledPref.value) // Don't care for autoPref.value in this case.
radiogroup.value = "manual"; // 3. Never check for updates.
else if (autoPref.value) // enabledPref.value && autoPref.value
radiogroup.value = "auto"; // 1. Automatically install updates
else // enabledPref.value && !autoPref.value
if (!enabledPref.value) // Don't care for autoPref.value in this case.
radiogroup.value = "manual"; // 3. Never check for updates.
else if (autoPref.value) // enabledPref.value && autoPref.value
radiogroup.value = "auto"; // 1. Automatically install updates
else // enabledPref.value && !autoPref.value
radiogroup.value = "checkOnly"; // 2. Check, but let me choose
var canCheck = Components.classes["@mozilla.org/updates/update-service;1"].
@ -1294,7 +1294,7 @@ var gMainPane = {
var autoPref = document.getElementById("app.update.auto");
var radiogroup = document.getElementById("updateRadioGroup");
switch (radiogroup.value) {
case "auto": // 1. Automatically install updates for Desktop only
case "auto": // 1. Automatically install updates for Desktop only
enabledPref.value = true;
autoPref.value = true;
break;
@ -1302,7 +1302,7 @@ var gMainPane = {
enabledPref.value = true;
autoPref.value = false;
break;
case "manual": // 3. Never check for updates.
case "manual": // 3. Never check for updates.
enabledPref.value = false;
autoPref.value = false;
}

Просмотреть файл

@ -21,7 +21,7 @@ function initTest() {
[dummyTerm + ".edu", searchTerm + dummyTerm, dummyTerm], // match
[dummyTerm + ".net", dummyTerm, searchTerm], // match
[dummyTerm + ".org", dummyTerm, searchTerm + dummyTerm], // match
[dummyTerm + ".int", dummyTerm, dummyTerm]]; // no match
[dummyTerm + ".int", dummyTerm, dummyTerm]]; // no match
// matches must correspond to above data
const matches = 6;

Просмотреть файл

@ -59,7 +59,7 @@ var gLanguagesDialog = {
var property = currString.key.split("."); // ab[-cd].accept
if (property[1] == "accept") {
var abCD = property[0];
var abCDPairs = abCD.split("-"); // ab[-cd]
var abCDPairs = abCD.split("-"); // ab[-cd]
var useABCDFormat = abCDPairs.length > 1;
var ab = useABCDFormat ? abCDPairs[0] : abCD;
var cd = useABCDFormat ? abCDPairs[1] : "";

Просмотреть файл

@ -22,7 +22,7 @@ function clearAllImageCaches() {
let tools = SpecialPowers.Cc["@mozilla.org/image/tools;1"]
.getService(SpecialPowers.Ci.imgITools);
let imageCache = tools.getImgCacheForDocument(window.document);
imageCache.clearCache(true); // true=chrome
imageCache.clearCache(true); // true=chrome
imageCache.clearCache(false); // false=content
}

Просмотреть файл

@ -247,8 +247,8 @@ var Agent = {
// Find all backups
let iterator;
let backups = []; // array that will contain the paths to all upgrade backup
let upgradeBackupPrefix = this.Paths.upgradeBackupPrefix; // access for forEach callback
let backups = []; // array that will contain the paths to all upgrade backup
let upgradeBackupPrefix = this.Paths.upgradeBackupPrefix; // access for forEach callback
try {
iterator = new File.DirectoryIterator(this.Paths.backups);

Просмотреть файл

@ -47,11 +47,11 @@ add_task(async function test_undoCloseById() {
// Open and close another window.
let win2 = await openWindow("about:mozilla");
await closeWindow(win2); // closedId == initialClosedId + 1
await closeWindow(win2); // closedId == initialClosedId + 1
is(SessionStore.lastClosedObjectType, "window", "The last closed object is a window");
// Open and close another tab in the first window.
await openAndCloseTab(win, "about:robots"); // closedId == initialClosedId + 2
await openAndCloseTab(win, "about:robots"); // closedId == initialClosedId + 2
is(SessionStore.lastClosedObjectType, "tab", "The last closed object is a tab");
// Undo closing the second tab.

Просмотреть файл

@ -19,11 +19,11 @@ var HeuristicsRegExp = {
// ==== Email ====
"email": new RegExp(
"e.?mail" +
"|courriel" + // fr
"|メールアドレス" + // ja-JP
"|Электронной.?Почты" + // ru
"|邮件|邮箱" + // zh-CN
"|電郵地址" + // zh-TW
"|courriel" + // fr
"|メールアドレス" + // ja-JP
"|Электронной.?Почты" + // ru
"|邮件|邮箱" + // zh-CN
"|電郵地址" + // zh-TW
"|(?:이메일|전자.?우편|[Ee]-?mail)(.?주소)?", // ko-KR
"iu"
),
@ -31,18 +31,18 @@ var HeuristicsRegExp = {
// ==== Telephone ====
"tel-extension": new RegExp(
"\\bext|ext\\b|extension" +
"|ramal", // pt-BR, pt-PT
"|ramal", // pt-BR, pt-PT
"iu"
),
"tel": new RegExp(
"phone|mobile|contact.?number" +
"|telefonnummer" + // de-DE
"|telefono|teléfono" + // es
"|telfixe" + // fr-FR
"|電話" + // ja-JP
"|telefone|telemovel" + // pt-BR, pt-PT
"|телефон" + // ru
"|电话" + // zh-CN
"|telefonnummer" + // de-DE
"|telefono|teléfono" + // es
"|telfixe" + // fr-FR
"|電話" + // ja-JP
"|telefone|telemovel" + // pt-BR, pt-PT
"|телефон" + // ru
"|电话" + // zh-CN
"|(?:전화|핸드폰|휴대폰|휴대전화)(?:.?번호)?", // ko-KR
"iu"
),
@ -50,14 +50,14 @@ var HeuristicsRegExp = {
// ==== Address Fields ====
"organization": new RegExp(
"company|business|organization|organisation" +
"|firma|firmenname" + // de-DE
"|empresa" + // es
"|societe|société" + // fr-FR
"|ragione.?sociale" + // it-IT
"|会社" + // ja-JP
"|firma|firmenname" + // de-DE
"|empresa" + // es
"|societe|société" + // fr-FR
"|ragione.?sociale" + // it-IT
"|会社" + // ja-JP
"|название.?компании" + // ru
"|单位|公司" + // zh-CN
"|회사|직장", // ko-KR
"|单位|公司" + // zh-CN
"|회사|직장", // ko-KR
"iu"
),
"street-address": new RegExp(
@ -73,10 +73,10 @@ var HeuristicsRegExp = {
"|adresse" + // fr-FR
"|indirizzo" + // it-IT
"|^住所$|住所1" + // ja-JP
"|morada|endereço" + // pt-BR, pt-PT
"|morada|endereço" + // pt-BR, pt-PT
"|Адрес" + // ru
"|地址" + // zh-CN
"|^주소.?$|주소.?1", // ko-KR
"|地址" + // zh-CN
"|^주소.?$|주소.?1", // ko-KR
"iu"
),
"address-line2": new RegExp(
@ -89,7 +89,7 @@ var HeuristicsRegExp = {
"|complemento|addrcomplement" + // pt-BR, pt-PT
"|Улица" + // ru
"|地址2" + // zh-CN
"|주소.?2", // ko-KR
"|주소.?2", // ko-KR
"iu"
),
"address-line3": new RegExp(
@ -102,7 +102,7 @@ var HeuristicsRegExp = {
"|complemento|addrcomplement" + // pt-BR, pt-PT
"|Улица" + // ru
"|地址3" + // zh-CN
"|주소.?3", // ko-KR
"|주소.?3", // ko-KR
"iu"
),
"address-level2": new RegExp(
@ -111,13 +111,13 @@ var HeuristicsRegExp = {
"|suburb" + // en-AU
"|ciudad|provincia|localidad|poblacion" + // es
"|ville|commune" + // fr-FR
"|localita" + // it-IT
"|市区町村" + // ja-JP
"|localita" + // it-IT
"|市区町村" + // ja-JP
"|cidade" + // pt-BR, pt-PT
"|Город" + // ru
"|市" + // zh-CN
"|分區" + // zh-TW
"|^시[^도·・]|시[·・]?군[·・]?구", // ko-KR
"|^시[^도·・]|시[·・]?군[·・]?구", // ko-KR
"iu"
),
"address-level1": new RegExp(
@ -132,30 +132,30 @@ var HeuristicsRegExp = {
"|область" + // ru
"|省" + // zh-CN
"|地區" + // zh-TW
"|^시[·・]?도", // ko-KR
"|^시[·・]?도", // ko-KR
"iu"
),
"postal-code": new RegExp(
"zip|postal|post.*code|pcode" +
"|pin.?code" + // en-IN
"|postleitzahl" + // de-DE
"|\\bcp\\b" + // es
"|\\bcdp\\b" + // fr-FR
"|\\bcap\\b" + // it-IT
"|郵便番号" + // ja-JP
"|pin.?code" + // en-IN
"|postleitzahl" + // de-DE
"|\\bcp\\b" + // es
"|\\bcdp\\b" + // fr-FR
"|\\bcap\\b" + // it-IT
"|郵便番号" + // ja-JP
"|codigo|codpos|\\bcep\\b" + // pt-BR, pt-PT
"|Почтовый.?Индекс" + // ru
"|邮政编码|邮编" + // zh-CN
"|郵遞區號" + // zh-TW
"|우편.?번호", // ko-KR
"|Почтовый.?Индекс" + // ru
"|邮政编码|邮编" + // zh-CN
"|郵遞區號" + // zh-TW
"|우편.?번호", // ko-KR
"iu"
),
"country": new RegExp(
"country|countries" +
"|país|pais" + // es
"|国" + // ja-JP
"|国家" + // zh-CN
"|국가|나라", // ko-KR
"|国" + // ja-JP
"|国家" + // zh-CN
"|국가|나라", // ko-KR
"iu"
),
@ -164,22 +164,22 @@ var HeuristicsRegExp = {
"^name|full.?name|your.?name|customer.?name|bill.?name|ship.?name" +
"|name.*first.*last|firstandlastname" +
"|nombre.*y.*apellidos" + // es
"|^nom" + // fr-FR
"|お名前|氏名" + // ja-JP
"|^nome" + // pt-BR, pt-PT
"|姓名" + // zh-CN
"|성명", // ko-KR
"|^nom" + // fr-FR
"|お名前|氏名" + // ja-JP
"|^nome" + // pt-BR, pt-PT
"|姓名" + // zh-CN
"|성명", // ko-KR
"iu"
),
"given-name": new RegExp(
"first.*name|initials|fname|first$|given.*name" +
"|vorname" + // de-DE
"|nombre" + // es
"|vorname" + // de-DE
"|nombre" + // es
"|forename|prénom|prenom" + // fr-FR
"|名" + // ja-JP
"|nome" + // pt-BR, pt-PT
"|Имя" + // ru
"|이름", // ko-KR
"|名" + // ja-JP
"|nome" + // pt-BR, pt-PT
"|Имя" + // ru
"|이름", // ko-KR
"iu"
),
"additional-name": new RegExp(
@ -192,14 +192,14 @@ var HeuristicsRegExp = {
),
"family-name": new RegExp(
"last.*name|lname|surname|last$|secondname|family.*name" +
"|nachname" + // de-DE
"|apellido" + // es
"|famille|^nom" + // fr-FR
"|cognome" + // it-IT
"|姓" + // ja-JP
"|nachname" + // de-DE
"|apellido" + // es
"|famille|^nom" + // fr-FR
"|cognome" + // it-IT
"|姓" + // ja-JP
"|morada|apelidos|surename|sobrenome" + // pt-BR, pt-PT
"|Фамилия" + // ru
"|\\b성(?:[^명]|\\b)", // ko-KR
"|Фамилия" + // ru
"|\\b성(?:[^명]|\\b)", // ko-KR
"iu"
),
@ -207,59 +207,59 @@ var HeuristicsRegExp = {
"cc-name": new RegExp(
"card.?(?:holder|owner)|name.*(\\b)?on(\\b)?.*card" +
"|(?:card|cc).?name|cc.?full.?name" +
"|karteninhaber" + // de-DE
"|nombre.*tarjeta" + // es
"|nom.*carte" + // fr-FR
"|nome.*cart" + // it-IT
"|名前" + // ja-JP
"|Имя.*карты" + // ru
"|karteninhaber" + // de-DE
"|nombre.*tarjeta" + // es
"|nom.*carte" + // fr-FR
"|nome.*cart" + // it-IT
"|名前" + // ja-JP
"|Имя.*карты" + // ru
"|信用卡开户名|开户名|持卡人姓名" + // zh-CN
"|持卡人姓名", // zh-TW
"|持卡人姓名", // zh-TW
"iu"
),
"cc-number": new RegExp(
"(add)?(?:card|cc|acct).?(?:number|#|no|num|field)" +
"|nummer" + // de-DE
"|nummer" + // de-DE
"|credito|numero|número" + // es
"|numéro" + // fr-FR
"|カード番号" + // ja-JP
"|Номер.*карты" + // ru
"|信用卡号|信用卡号码" + // zh-CN
"|信用卡卡號" + // zh-TW
"|카드", // ko-KR
"|numéro" + // fr-FR
"|カード番号" + // ja-JP
"|Номер.*карты" + // ru
"|信用卡号|信用卡号码" + // zh-CN
"|信用卡卡號" + // zh-TW
"|카드", // ko-KR
"iu"
),
"cc-exp-month": new RegExp(
"expir|exp.*mo|exp.*date|ccmonth|cardmonth|addmonth" +
"|gueltig|gültig|monat" + // de-DE
"|fecha" + // es
"|date.*exp" + // fr-FR
"|scadenza" + // it-IT
"|有効期限" + // ja-JP
"|validade" + // pt-BR, pt-PT
"|Срок действия карты" + // ru
"|月", // zh-CN,
"|fecha" + // es
"|date.*exp" + // fr-FR
"|scadenza" + // it-IT
"|有効期限" + // ja-JP
"|validade" + // pt-BR, pt-PT
"|Срок действия карты" + // ru
"|月", // zh-CN,
"iu"
),
"cc-exp-year": new RegExp(
"exp|^/|(add)?year" +
"|ablaufdatum|gueltig|gültig|jahr" + // de-DE
"|fecha" + // es
"|scadenza" + // it-IT
"|有効期限" + // ja-JP
"|validade" + // pt-BR, pt-PT
"|Срок действия карты" + // ru
"|年|有效期", // zh-CN
"|fecha" + // es
"|scadenza" + // it-IT
"|有効期限" + // ja-JP
"|validade" + // pt-BR, pt-PT
"|Срок действия карты" + // ru
"|年|有效期", // zh-CN
"iu"
),
"cc-exp": new RegExp(
"expir|exp.*date|^expfield$" +
"|gueltig|gültig" + // de-DE
"|fecha" + // es
"|date.*exp" + // fr-FR
"|scadenza" + // it-IT
"|有効期限" + // ja-JP
"|validade" + // pt-BR, pt-PT
"|gueltig|gültig" + // de-DE
"|fecha" + // es
"|date.*exp" + // fr-FR
"|scadenza" + // it-IT
"|有効期限" + // ja-JP
"|validade" + // pt-BR, pt-PT
"|Срок действия карты", // ru
"iu"
),

Просмотреть файл

@ -56,7 +56,7 @@ var pktApi = (function() {
*/
// Base url for all api calls
var pocketAPIhost = Services.prefs.getCharPref("extensions.pocket.api"); // api.getpocket.com
var pocketAPIhost = Services.prefs.getCharPref("extensions.pocket.api"); // api.getpocket.com
var pocketSiteHost = Services.prefs.getCharPref("extensions.pocket.site"); // getpocket.com
var baseAPIUrl = "https://" + pocketAPIhost + "/v3";

Просмотреть файл

@ -10,7 +10,7 @@ Cu.importGlobalProperties(["crypto", "TextEncoder"]);
this.EXPORTED_SYMBOLS = ["Sampling"];
const hashBits = 48;
const hashLength = hashBits / 4; // each hexadecimal digit represents 4 bits
const hashLength = hashBits / 4; // each hexadecimal digit represents 4 bits
const hashMultiplier = Math.pow(2, hashBits) - 1;
this.Sampling = {

Просмотреть файл

@ -37,8 +37,8 @@ const MAX_ORDINAL = 99;
* set of tools and keeps track of open toolboxes in the browser.
*/
function DevTools() {
this._tools = new Map(); // Map<toolId, tool>
this._themes = new Map(); // Map<themeId, theme>
this._tools = new Map(); // Map<toolId, tool>
this._themes = new Map(); // Map<themeId, theme>
this._toolboxes = new Map(); // Map<target, toolbox>
// List of toolboxes that are still in process of creation
this._creatingToolboxes = new Map(); // Map<target, toolbox Promise>

Просмотреть файл

@ -12,8 +12,8 @@
"use strict";
var re = /(^([+\-]?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?(?=\D|\s|$))|^0x[\da-fA-F]+$|\d+)/g;
var sre = /^\s+|\s+$/g; // trim pre-post whitespace
var snre = /\s+/g; // normalize all whitespace to single ' ' character
var sre = /^\s+|\s+$/g; // trim pre-post whitespace
var snre = /\s+/g; // normalize all whitespace to single ' ' character
// eslint-disable-next-line
var dre = /(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/;

Просмотреть файл

@ -552,7 +552,7 @@ Editor.prototype = {
setText: function (value) {
let cm = editors.get(this);
if (typeof value !== "string" && "binary" in value) { // wasm?
if (typeof value !== "string" && "binary" in value) { // wasm?
// binary does not survive as Uint8Array, converting from string
let binary = value.binary;
let data = new Uint8Array(binary.length);

Просмотреть файл

@ -264,12 +264,14 @@ TouchSimulator.prototype = {
}
}
let unwrapped = XPCNativeWrapper.unwrap(target);
/* eslint-disable no-multi-spaces */
unwrapped.sendTouchEvent(name, clone([0]), // event type, id
clone([evt.clientX]), // x
clone([evt.clientY]), // y
clone([1]), clone([1]), // rx, ry
clone([0]), clone([0]), // rotation, force
1); // count
/* eslint-enable no-multi-spaces */
return;
}
let document = target.ownerDocument;
@ -344,9 +346,9 @@ TouchSimulator.prototype = {
// delay. But Firefox didn't support this property now, we can't get
// this value from utils.getVisitedDependentComputedStyle() to check
// if we should suppress 300ms delay.
if (!allowZoom.value || // user-scalable = no
minZoom.value === maxZoom.value || // minimum-scale = maximum-scale
autoSize.value // width = device-width
if (!allowZoom.value || // user-scalable = no
minZoom.value === maxZoom.value || // minimum-scale = maximum-scale
autoSize.value // width = device-width
) {
return 0;
}

Просмотреть файл

@ -17,20 +17,20 @@
// White space of any kind. No value fields are used. Note that
// comments do *not* count as white space; comments separate tokens
// but are not themselves tokens.
const eCSSToken_Whitespace = "whitespace"; //
const eCSSToken_Whitespace = "whitespace"; //
// A comment.
const eCSSToken_Comment = "comment"; // /*...*/
const eCSSToken_Comment = "comment"; // /*...*/
// Identifier-like tokens. mIdent is the text of the identifier.
// The difference between ID and Hash is: if the text after the #
// would have been a valid Ident if the # hadn't been there, the
// scanner produces an ID token. Otherwise it produces a Hash token.
// (This distinction is required by css3-selectors.)
const eCSSToken_Ident = "ident"; // word
const eCSSToken_Function = "function"; // word(
const eCSSToken_AtKeyword = "at"; // @word
const eCSSToken_ID = "id"; // #word
const eCSSToken_Hash = "hash"; // #0word
const eCSSToken_Ident = "ident"; // word
const eCSSToken_Function = "function"; // word(
const eCSSToken_AtKeyword = "at"; // @word
const eCSSToken_ID = "id"; // #word
const eCSSToken_Hash = "hash"; // #0word
// Numeric tokens. mNumber is the floating-point value of the
// number, and mHasSign indicates whether there was an explicit sign
@ -42,32 +42,32 @@ const eCSSToken_Hash = "hash"; // #0word
// are always considered not to be integers, even if their numeric
// value is integral (100% => mNumber = 1.0). For Dimension
// tokens, mIdent holds the text of the unit.
const eCSSToken_Number = "number"; // 1 -5 +2e3 3.14159 7.297352e-3
const eCSSToken_Dimension = "dimension"; // 24px 8.5in
const eCSSToken_Percentage = "percentage"; // 85% 1280.4%
const eCSSToken_Number = "number"; // 1 -5 +2e3 3.14159 7.297352e-3
const eCSSToken_Dimension = "dimension"; // 24px 8.5in
const eCSSToken_Percentage = "percentage"; // 85% 1280.4%
// String-like tokens. In all cases, mIdent holds the text
// belonging to the string, and mSymbol holds the delimiter
// character, which may be ', ", or zero (only for unquoted URLs).
// Bad_String and Bad_URL tokens are emitted when the closing
// delimiter or parenthesis was missing.
const eCSSToken_String = "string"; // 'foo bar' "foo bar"
const eCSSToken_Bad_String = "bad_string"; // 'foo bar
const eCSSToken_URL = "url"; // url(foobar) url("foo bar")
const eCSSToken_Bad_URL = "bad_url"; // url(foo
const eCSSToken_String = "string"; // 'foo bar' "foo bar"
const eCSSToken_Bad_String = "bad_string"; // 'foo bar
const eCSSToken_URL = "url"; // url(foobar) url("foo bar")
const eCSSToken_Bad_URL = "bad_url"; // url(foo
// Any one-character symbol. mSymbol holds the character.
const eCSSToken_Symbol = "symbol"; // . ; { } ! *
const eCSSToken_Symbol = "symbol"; // . ; { } ! *
// Match operators. These are single tokens rather than pairs of
// Symbol tokens because css3-selectors forbids the presence of
// comments between the two characters. No value fields are used;
// the token type indicates which operator.
const eCSSToken_Includes = "includes"; // ~=
const eCSSToken_Dashmatch = "dashmatch"; // |=
const eCSSToken_Beginsmatch = "beginsmatch"; // ^=
const eCSSToken_Endsmatch = "endsmatch"; // $=
const eCSSToken_Containsmatch = "containsmatch"; // *=
const eCSSToken_Includes = "includes"; // ~=
const eCSSToken_Dashmatch = "dashmatch"; // |=
const eCSSToken_Beginsmatch = "beginsmatch"; // ^=
const eCSSToken_Endsmatch = "endsmatch"; // $=
const eCSSToken_Containsmatch = "containsmatch"; // *=
// Unicode-range token: currently used only in @font-face.
// The lexical rule for this token includes several forms that are
@ -77,7 +77,7 @@ const eCSSToken_Containsmatch = "containsmatch"; // *=
// token is semantically valid. In that case, mInteger holds the
// lowest value included in the range, and mInteger2 holds the
// highest value included in the range.
const eCSSToken_URange = "urange"; // U+007e U+01?? U+2000-206F
const eCSSToken_URange = "urange"; // U+007e U+01?? U+2000-206F
// HTML comment delimiters, ignored as a unit when they appear at
// the top level of a style sheet, for compatibility with websites
@ -85,7 +85,7 @@ const eCSSToken_URange = "urange"; // U+007e U+01?? U+2000-206F
// subsumes the css2.1 CDO and CDC tokens, which are always treated
// the same by the parser. mIdent holds the text of the token, for
// diagnostics.
const eCSSToken_HTMLComment = "htmlcomment"; // <!-- -->
const eCSSToken_HTMLComment = "htmlcomment"; // <!-- -->
const eEOFCharacters_None = 0x0000;

Просмотреть файл

@ -15,7 +15,7 @@ Linkifier.prototype = {
let cleanedText = "";
for (let i = 0; i < aNumberText.length; i++) {
let c = aNumberText.charAt(i);
if ((c >= "0" && c <= "9") || c == "+") // assuming there is only the leading '+'.
if ((c >= "0" && c <= "9") || c == "+") // assuming there is only the leading '+'.
cleanedText += c;
}
anchorNode.setAttribute("href", "tel:" + cleanedText);

Просмотреть файл

@ -6,12 +6,12 @@
var {classes: Cc, interfaces: Ci, manager: Cm, utils: Cu} = Components;
Cu.import("resource://gre/modules/Services.jsm");
const VKB_ENTER_KEY = 13; // User press of VKB enter key
const INITIAL_PAGE_DELAY = 500; // Initial pause on program start for scroll alignment
const PREFS_BUFFER_MAX = 30; // Max prefs buffer size for getPrefsBuffer()
const PAGE_SCROLL_TRIGGER = 200; // Triggers additional getPrefsBuffer() on user scroll-to-bottom
const FILTER_CHANGE_TRIGGER = 200; // Delay between responses to filterInput changes
const INNERHTML_VALUE_DELAY = 100; // Delay before providing prefs innerHTML value
const VKB_ENTER_KEY = 13; // User press of VKB enter key
const INITIAL_PAGE_DELAY = 500; // Initial pause on program start for scroll alignment
const PREFS_BUFFER_MAX = 30; // Max prefs buffer size for getPrefsBuffer()
const PAGE_SCROLL_TRIGGER = 200; // Triggers additional getPrefsBuffer() on user scroll-to-bottom
const FILTER_CHANGE_TRIGGER = 200; // Delay between responses to filterInput changes
const INNERHTML_VALUE_DELAY = 100; // Delay before providing prefs innerHTML value
var gStringBundle = Services.strings.createBundle("chrome://browser/locale/config.properties");
var gClipboardHelper = Cc["@mozilla.org/widget/clipboardhelper;1"].getService(Ci.nsIClipboardHelper);

Просмотреть файл

@ -98,10 +98,10 @@ PresentationDevicePrompt.prototype = {
return;
}
if (aIndex < 0) { // Cancel request if no selected device,
if (aIndex < 0) { // Cancel request if no selected device,
this._request.cancel(Cr.NS_ERROR_DOM_NOT_ALLOWED_ERR);
return;
} else if (!this._devices.length) { // or there is no available devices
} else if (!this._devices.length) { // or there is no available devices
this._request.cancel(Cr.NS_ERROR_DOM_NOT_FOUND_ERR);
return;
}

Просмотреть файл

@ -249,7 +249,7 @@ function getDefault(map, key, defaultMaker) {
// Construct a filtration network of rules.
function ruleset(...rules) {
const rulesByInputFlavor = new Map(); // [someInputFlavor: [rule, ...]]
const rulesByInputFlavor = new Map(); // [someInputFlavor: [rule, ...]]
// File each rule under its input flavor:
forEach(rule => getDefault(rulesByInputFlavor, rule.source.inputFlavor, () => []).push(rule),
@ -266,7 +266,7 @@ function ruleset(...rules) {
// Introduce the whole DOM into the KB as flavor 'dom' to get
// things started:
const nonterminals = [[{tree}, "dom"]]; // [[node, flavor], [node, flavor], ...]
const nonterminals = [[{tree}, "dom"]]; // [[node, flavor], [node, flavor], ...]
// While there are new facts, run the applicable rules over them to
// generate even newer facts. Repeat until everything's fully
@ -318,7 +318,7 @@ function ruleset(...rules) {
// that).
if (!outNode.flavors.has(fact.flavor)) {
outNode.flavors.set(fact.flavor, fact.notes);
kb.indexNodeByFlavor(outNode, fact.flavor); // TODO: better encapsulation rather than indexing explicitly
kb.indexNodeByFlavor(outNode, fact.flavor); // TODO: better encapsulation rather than indexing explicitly
nonterminals.push([outNode, fact.flavor]);
}
}
@ -334,7 +334,7 @@ function ruleset(...rules) {
// flavor (used to dispatch further rules upon), a corresponding DOM element, a
// score, and some other arbitrary notes opaque to fathom.
function knowledgebase() {
const nodesByFlavor = new Map(); // Map{'texty' -> [NodeA],
const nodesByFlavor = new Map(); // Map{'texty' -> [NodeA],
// 'spiffy' -> [NodeA, NodeB]}
// NodeA = {element: <someElement>,
//
@ -395,7 +395,7 @@ function* resultsOfDomRule(rule, specialDomNode, kb) {
// Use the special "tree" property of the special starting node:
const matches = specialDomNode.tree.querySelectorAll(rule.source.selector);
for (let i = 0; i < matches.length; i++) { // matches is a NodeList, which doesn't conform to iterator protocol
for (let i = 0; i < matches.length; i++) { // matches is a NodeList, which doesn't conform to iterator protocol
const element = matches[i];
const newFacts = explicitFacts(rule.ranker(kb.nodeForElement(element)));
for (let fact of newFacts) {

Просмотреть файл

@ -38,8 +38,8 @@
var BrowserApp = Services.wm.getMostRecentWindow("navigator:browser").BrowserApp;
SimpleTest.waitForExplicitFinish();
SimpleTest.requestLongerTimeout(3); // several long waits and GCs make for a long-running test
SimpleTest.requestCompleteLog(); // so that "PERFHERDER_DATA" can be scraped from the log
SimpleTest.requestLongerTimeout(3); // several long waits and GCs make for a long-running test
SimpleTest.requestCompleteLog(); // so that "PERFHERDER_DATA" can be scraped from the log
function checkpoint(aName) {
var mrm = Cc["@mozilla.org/memory-reporter-manager;1"].getService(Ci.nsIMemoryReporterManager);

Просмотреть файл

@ -163,7 +163,7 @@ function run_compound_tests() {
0x02, 0x03, 0x45, 0x46, 0x47, // INTEGER
0x30, 0x06, // SEQUENCE
0x02, 0x02, 0x00, 0xff, // INTEGER
0x05, 0x00 ]; // NULL
0x05, 0x00 ]; // NULL
let der = new DER.DER(derBytes);
let contents = new DER.DER(der.readTagAndGetContents(DER.SEQUENCE));
let firstINTEGER = contents.readTagAndGetContents(DER.INTEGER);
@ -199,7 +199,7 @@ function run_compound_tests() {
0x30, 0x02, // SEQUENCE
0x02, 0x01, // INTEGER (missing data)
0x05, 0x00, // NULL
0x00, 0x00 ]; // (extra data)
0x00, 0x00 ]; // (extra data)
let invalidDER = new DER.DER(invalidDERBytes);
let invalidContents = new DER.DER(
invalidDER.readTagAndGetContents(DER.SEQUENCE));

Просмотреть файл

@ -9,7 +9,7 @@ Cu.import("resource://services-common/utils.js");
_("Make sure querySpinningly will synchronously fetch rows for a query asyncly");
const SQLITE_CONSTRAINT_VIOLATION = 19; // http://www.sqlite.org/c3ref/c_abort.html
const SQLITE_CONSTRAINT_VIOLATION = 19; // http://www.sqlite.org/c3ref/c_abort.html
// This test is a bit hacky - it was originally written to use the
// formhistory.sqlite database using the nsIFormHistory2 sync APIs. However,

Просмотреть файл

@ -304,7 +304,7 @@ this.CommonUtils = {
function advance() {
c = str[cOffset++];
if (!c || c == "" || c == "=") // Easier than range checking.
throw new Error("Done"); // Will be caught far away.
throw new Error("Done"); // Will be caught far away.
val = key.indexOf(c);
if (val == -1)
throw new Error(`Unknown character in base32: ${c}`);

Просмотреть файл

@ -76,12 +76,12 @@ exports.ASSERTION_LIFETIME = 1000 * 3600 * 24 * 365 * 25; // 25 years
// valid after we generate it (e.g., the signed cert won't expire in this
// period).
exports.ASSERTION_USE_PERIOD = 1000 * 60 * 5; // 5 minutes
exports.CERT_LIFETIME = 1000 * 3600 * 6; // 6 hours
exports.CERT_LIFETIME = 1000 * 3600 * 6; // 6 hours
exports.KEY_LIFETIME = 1000 * 3600 * 12; // 12 hours
// After we start polling for account verification, we stop polling when this
// many milliseconds have elapsed.
exports.POLL_SESSION = 1000 * 60 * 20; // 20 minutes
exports.POLL_SESSION = 1000 * 60 * 20; // 20 minutes
// Observer notifications.
exports.ONLOGIN_NOTIFICATION = "fxaccounts:onlogin";

Просмотреть файл

@ -87,7 +87,7 @@ this.FakeGUIDService = function FakeGUIDService() {
this.FakeCryptoService = function FakeCryptoService() {
this.counter = 0;
delete Weave.Crypto; // get rid of the getter first
delete Weave.Crypto; // get rid of the getter first
Weave.Crypto = this;
CryptoWrapper.prototype.ciphertextHMAC = function ciphertextHMAC(keyBundle) {

Просмотреть файл

@ -972,9 +972,9 @@ ClientStore.prototype = {
}
// Optional fields.
record.os = Services.appinfo.OS; // "Darwin"
record.os = Services.appinfo.OS; // "Darwin"
record.appPackage = Services.appinfo.ID;
record.application = this.engine.brandName; // "Nightly"
record.application = this.engine.brandName; // "Nightly"
// We can't compute these yet.
// record.device = ""; // Bug 1100723

Просмотреть файл

@ -18,7 +18,7 @@ Cu.import("resource://gre/modules/Log.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "FormHistory",
"resource://gre/modules/FormHistory.jsm");
const FORMS_TTL = 3 * 365 * 24 * 60 * 60; // Three years in seconds.
const FORMS_TTL = 3 * 365 * 24 * 60 * 60; // Three years in seconds.
this.FormRec = function FormRec(collection, id) {
CryptoWrapper.call(this, collection, id);

Просмотреть файл

@ -6,8 +6,8 @@ this.EXPORTED_SYMBOLS = ["TabEngine", "TabSetRecord"];
var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
const TABS_TTL = 1814400; // 21 days.
const TAB_ENTRIES_LIMIT = 5; // How many URLs to include in tab history.
const TABS_TTL = 1814400; // 21 days.
const TAB_ENTRIES_LIMIT = 5; // How many URLs to include in tab history.
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
@ -184,7 +184,7 @@ TabStore.prototype = {
let urls = candidates.map((entry) => entry.url)
.filter(acceptable)
.reverse(); // Because Sync puts current at index 0, and history after.
.reverse(); // Because Sync puts current at index 0, and history after.
// Truncate if necessary.
if (urls.length > TAB_ENTRIES_LIMIT) {

Просмотреть файл

@ -635,8 +635,8 @@ ErrorHandler.prototype = {
}
break;
case "weave:engine:sync:error": {
let exception = subject; // exception thrown by engine's sync() method
let engine_name = data; // engine name that threw the exception
let exception = subject; // exception thrown by engine's sync() method
let engine_name = data; // engine name that threw the exception
this.checkServerError(exception);

Просмотреть файл

@ -30,8 +30,8 @@ Cu.import("resource://services-common/utils.js");
this.WBORecord = function WBORecord(collection, id) {
this.data = {};
this.payload = {};
this.collection = collection; // Optional.
this.id = id; // Optional.
this.collection = collection; // Optional.
this.id = id; // Optional.
};
WBORecord.prototype = {
_logName: "Sync.Record.WBO",
@ -51,7 +51,7 @@ WBORecord.prototype = {
let r = await resource.get();
if (r.success) {
this.deserialize(r); // Warning! Muffles exceptions!
this.deserialize(r); // Warning! Muffles exceptions!
}
this.response = r;
return this;
@ -455,7 +455,7 @@ CollectionKeyManager.prototype = {
const newKeys = Object.assign({}, this._collections);
for (let c of collections) {
if (newKeys[c]) {
continue; // don't replace existing keys
continue; // don't replace existing keys
}
const b = new BulkKeyBundle(c);

Просмотреть файл

@ -239,7 +239,7 @@ AsyncResource.prototype = {
try {
status = channel.responseStatus;
success = channel.requestSucceeded; // HTTP status.
success = channel.requestSucceeded; // HTTP status.
this._log.trace("Status: " + status);
this._log.trace("Success: " + success);

Просмотреть файл

@ -240,7 +240,7 @@ Sync11Service.prototype = {
if (keysChanged) {
// Did they change? If so, carry on.
this._log.info("Suggesting retry.");
return true; // Try again.
return true; // Try again.
}
// If not, reupload them and continue the current sync.
@ -255,7 +255,7 @@ Sync11Service.prototype = {
"Continuing sync; let's try again later.");
}
return false; // Don't try again: same keys.
return false; // Don't try again: same keys.
} catch (ex) {
this._log.warn("Got exception fetching and handling crypto keys. " +
@ -735,7 +735,7 @@ Sync11Service.prototype = {
throw new Error("Unable to upload symmetric keys.");
}
this._log.info("Got status " + uploadRes.status + " uploading keys.");
let serverModified = uploadRes.obj; // Modified timestamp according to server.
let serverModified = uploadRes.obj; // Modified timestamp according to server.
this._log.debug("Server reports crypto modified: " + serverModified);
// Now verify that info/collections shows them!

Просмотреть файл

@ -68,11 +68,13 @@ this.Utils = {
get userAgent() {
if (!this._userAgent) {
let hph = Cc["@mozilla.org/network/protocol;1?name=http"].getService(Ci.nsIHttpProtocolHandler);
/* eslint-disable no-multi-spaces */
this._userAgent =
Services.appinfo.name + "/" + Services.appinfo.version + // Product.
" (" + hph.oscpu + ")" + // (oscpu)
" FxSync/" + WEAVE_VERSION + "." + // Sync.
Services.appinfo.appBuildID + "."; // Build.
/* eslint-enable no-multi-spaces */
}
return this._userAgent + Svc.Prefs.get("client.type", "desktop");
},

Просмотреть файл

@ -31,7 +31,7 @@ async function sharedSetup() {
let collection = server.user("foo").collection("bookmarks");
Svc.Obs.notify("weave:engine:start-tracking"); // We skip usual startup...
Svc.Obs.notify("weave:engine:start-tracking"); // We skip usual startup...
return { engine, store, server, collection };
}

Просмотреть файл

@ -234,7 +234,7 @@ async function test_restoreOrImport(aReplace) {
let collection = server.user("foo").collection("bookmarks");
Svc.Obs.notify("weave:engine:start-tracking"); // We skip usual startup...
Svc.Obs.notify("weave:engine:start-tracking"); // We skip usual startup...
try {
@ -513,7 +513,7 @@ add_task(async function test_bookmark_guidMap_fail() {
let itemPayload = itemRecord.cleartext;
coll.insert(itemGUID, encryptPayload(itemPayload));
engine.lastSync = 1; // So we don't back up.
engine.lastSync = 1; // So we don't back up.
// Make building the GUID map fail.
@ -667,7 +667,7 @@ add_task(async function test_sync_dateAdded() {
// intermittently - reset the last sync date so that we'll get all bookmarks.
engine.lastSync = 1;
Svc.Obs.notify("weave:engine:start-tracking"); // We skip usual startup...
Svc.Obs.notify("weave:engine:start-tracking"); // We skip usual startup...
// Just matters that it's in the past, not how far.
let now = Date.now();
@ -816,7 +816,7 @@ add_task(async function test_sync_imap_URLs() {
let collection = server.user("foo").collection("bookmarks");
Svc.Obs.notify("weave:engine:start-tracking"); // We skip usual startup...
Svc.Obs.notify("weave:engine:start-tracking"); // We skip usual startup...
try {
collection.insert("menu", encryptPayload({

Просмотреть файл

@ -10,7 +10,7 @@ Cu.import("resource://services-sync/util.js");
Cu.import("resource://testing-common/services/sync/utils.js");
const MORE_THAN_CLIENTS_TTL_REFRESH = 691200; // 8 days
const LESS_THAN_CLIENTS_TTL_REFRESH = 86400; // 1 day
const LESS_THAN_CLIENTS_TTL_REFRESH = 86400; // 1 day
let engine;
@ -123,7 +123,7 @@ add_task(async function test_bad_hmac() {
deletedItems = [];
_("Change our keys and our client ID, reupload keys.");
let oldLocalID = engine.localID; // Preserve to test for deletion!
let oldLocalID = engine.localID; // Preserve to test for deletion!
engine.localID = Utils.makeGUID();
await engine.resetClient();
await generateNewKeys(Service.collectionKeys);
@ -176,7 +176,7 @@ add_task(async function test_bad_hmac() {
// Create a new client record and new keys. Now our keys are wrong, as well
// as the object on the server. We'll download the new keys and also delete
// the bad client record.
oldLocalID = engine.localID; // Preserve to test for deletion!
oldLocalID = engine.localID; // Preserve to test for deletion!
engine.localID = Utils.makeGUID();
await engine.resetClient();
await generateNewKeys(Service.collectionKeys);

Просмотреть файл

@ -110,9 +110,9 @@ add_task(async function testDeclinedMeta() {
manager._engines.petrol.enabled = true;
manager._engines.diesel.enabled = true;
manager._engines.dummy.enabled = true;
manager._engines.actual.enabled = false; // Disabled but not declined.
manager._engines.actual.enabled = false; // Disabled but not declined.
manager.decline(["localdecline"]); // Declined and not supported.
manager.decline(["localdecline"]); // Declined and not supported.
let declinedEngines = new DeclinedEngines(Service);

Просмотреть файл

@ -69,7 +69,7 @@ add_task(async function test_200_hard() {
let promiseObserved = promiseOneObserver("weave:eol");
await Service._fetchInfo();
Service.scheduler.adjustSyncInterval(); // As if we failed or succeeded in syncing.
Service.scheduler.adjustSyncInterval(); // As if we failed or succeeded in syncing.
let { subject } = await promiseObserved;
do_check_eq("hard-eol", subject.code);
@ -89,7 +89,7 @@ add_task(async function test_513_hard() {
try {
await Service._fetchInfo();
Service.scheduler.adjustSyncInterval(); // As if we failed or succeeded in syncing.
Service.scheduler.adjustSyncInterval(); // As if we failed or succeeded in syncing.
} catch (ex) {
// Because fetchInfo will fail on a 513.
}
@ -111,7 +111,7 @@ add_task(async function test_200_soft() {
let promiseObserved = promiseOneObserver("weave:eol");
await Service._fetchInfo();
Service.scheduler.adjustSyncInterval(); // As if we failed or succeeded in syncing.
Service.scheduler.adjustSyncInterval(); // As if we failed or succeeded in syncing.
let { subject } = await promiseObserved;
do_check_eq("soft-eol", subject.code);
do_check_soft_eol(eh, start);

Просмотреть файл

@ -16,7 +16,7 @@ const logsdir = FileUtils.getDir("ProfD", ["weave", "logs"], true);
// so otherwise we can end up with all of our files -- the ones we want to
// keep, and the ones we want to clean up -- having the same modified time.
const CLEANUP_DELAY = 2000;
const DELAY_BUFFER = 500; // Buffer for timers on different OS platforms.
const DELAY_BUFFER = 500; // Buffer for timers on different OS platforms.
const PROLONGED_ERROR_DURATION =
(Svc.Prefs.get("errorhandler.networkFailureReportTimeout") * 2) * 1000;

Просмотреть файл

@ -31,7 +31,7 @@ function mock(options) {
add_task(async function setup() {
await Service.engineManager.register(ExtensionStorageEngine);
engine = Service.engineManager.get("extension-storage");
do_get_profile(); // so we can use FxAccounts
do_get_profile(); // so we can use FxAccounts
loadWebExtensionTestFunctions();
});

Просмотреть файл

@ -16,7 +16,7 @@ let engine;
add_task(async function setup() {
await Service.engineManager.register(ExtensionStorageEngine);
engine = Service.engineManager.get("extension-storage");
do_get_profile(); // so we can use FxAccounts
do_get_profile(); // so we can use FxAccounts
loadWebExtensionTestFunctions();
});

Просмотреть файл

@ -83,7 +83,7 @@ add_task(async function hmac_error_during_404() {
_("Partially resetting client, as if after a restart, and forcing redownload.");
Service.collectionKeys.clear();
engine.lastSync = 0; // So that we redownload records.
engine.lastSync = 0; // So that we redownload records.
key404Counter = 1;
_("---------------------------");
await sync_and_validate_telem();

Просмотреть файл

@ -15,7 +15,7 @@ add_test(function test_creation() {
let server = new SyncServer({
__proto__: SyncServerCallback,
});
do_check_true(!!server); // Just so we have a check.
do_check_true(!!server); // Just so we have a check.
server.start(null, function() {
_("Started on " + server.port);
server.stop(run_next_test);

Просмотреть файл

@ -218,7 +218,7 @@ add_task(async function test_ensureLoggedIn() {
do_check_true(collectionKeys.updateNeeded(info_collections));
info_collections.crypto = 5000;
do_check_false(collectionKeys.updateNeeded(info_collections));
info_collections.crypto = 1 + (Date.now() / 1000); // Add one in case computers are fast!
info_collections.crypto = 1 + (Date.now() / 1000); // Add one in case computers are fast!
do_check_true(collectionKeys.updateNeeded(info_collections));
collectionKeys.lastModified = null;

Просмотреть файл

@ -69,7 +69,7 @@ add_task(async function test_fetch() {
// Testing collection extraction.
_("Extracting collection.");
let rec3 = new WBORecord("tabs", "foo"); // Create through constructor.
let rec3 = new WBORecord("tabs", "foo"); // Create through constructor.
do_check_eq(rec3.collection, "tabs");
} finally {

Просмотреть файл

@ -222,8 +222,8 @@ add_task(async function v5_upgrade() {
// Fill the keys with bad data.
let badKeys = new BulkKeyBundle("crypto");
await badKeys.generateRandom();
await update_server_keys(badKeys, "keys", "crypto/keys"); // v4
await update_server_keys(badKeys, "bulk", "crypto/bulk"); // v5
await update_server_keys(badKeys, "keys", "crypto/keys"); // v4
await update_server_keys(badKeys, "bulk", "crypto/bulk"); // v5
_("Generating new keys.");
await generateNewKeys(Service.collectionKeys);

Просмотреть файл

@ -130,7 +130,7 @@ add_task(async function test_login_on_sync() {
Service.login = async function() {
loginCalled = true;
Service.status.login = LOGIN_SUCCEEDED;
this._loggedIn = false; // So that sync aborts.
this._loggedIn = false; // So that sync aborts.
return true;
};

Просмотреть файл

@ -185,7 +185,7 @@ add_task(async function run_test() {
let keys = Service.collectionKeys.asWBO();
let b = new BulkKeyBundle("hmacerror");
await b.generateRandom();
collections.crypto = keys.modified = 100 + (Date.now() / 1000); // Future modification time.
collections.crypto = keys.modified = 100 + (Date.now() / 1000); // Future modification time.
await keys.encrypt(b);
await keys.upload(Service.resource(Service.cryptoKeysURL));

Просмотреть файл

@ -89,7 +89,7 @@ add_task(async function setup() {
add_test(function test_prefAttributes() {
_("Test various attributes corresponding to preferences.");
const INTERVAL = 42 * 60 * 1000; // 42 minutes
const INTERVAL = 42 * 60 * 1000; // 42 minutes
const THRESHOLD = 3142;
const SCORE = 2718;
const TIMESTAMP1 = 1275493471649;

Просмотреть файл

@ -5,7 +5,7 @@
// This file tests the unicode functions that we have added
const LATIN1_AE = "\xc6"; // "Æ"
const LATIN1_ae = "\xe6"; // "æ"
const LATIN1_ae = "\xe6"; // "æ"
add_task(async function setup() {
getOpenedDatabase().createTable("test", "id INTEGER PRIMARY KEY, name TEXT");

Просмотреть файл

@ -2043,7 +2043,7 @@ GeckoDriver.prototype.multiAction = async function(cmd) {
assert.window(this.getCurrentWindow());
assert.noUserPrompt(this.dialog);
let {value, max_length} = cmd.parameters; // eslint-disable-line camelcase
let {value, max_length} = cmd.parameters; // eslint-disable-line camelcase
this.addFrameCloseListener("multi action chain");
await this.listener.multiAction(value, max_length);

Просмотреть файл

@ -49,7 +49,7 @@ Cu.import("chrome://marionette/content/session.js");
Cu.importGlobalProperties(["URL"]);
let listenerId = null; // unique ID of this listener
let listenerId = null; // unique ID of this listener
let curContainer = {frame: content, shadowRoot: null};
let previousContainer = null;

Просмотреть файл

@ -381,8 +381,8 @@ min-width: 600px; min-height: 600px; max-width: 600px; max-height: 600px`;
canvas = capture.canvas(
win,
0, // left
0, // top
0, // left
0, // top
win.innerWidth,
win.innerHeight,
{canvas, flags});

Просмотреть файл

@ -456,7 +456,7 @@ SpecialPowersObserverAPI.prototype = {
default:
throw new SpecialPowersError("Invalid operation for SPObserverervice");
}
return undefined; // See comment at the beginning of this function.
return undefined; // See comment at the beginning of this function.
}
case "SPLoadChromeScript": {

Просмотреть файл

@ -931,7 +931,7 @@ function plLoadURLsFromURI(manifestUri) {
// Note that if we have the scrollTest flag but the item already has "%", then we do
// nothing (the scroll test will not execute, and the page will report with its
// own tpRecordTime and not the one from the scroll test).
if (scrollTest && items.length == 1) { // scroll enabled and no "%"
if (scrollTest && items.length == 1) { // scroll enabled and no "%"
items.unshift("%");
flags |= EXECUTE_SCROLL_TEST;
}

Просмотреть файл

@ -80,7 +80,7 @@ Report.prototype.getReport = function() {
report += "_x_x_mozilla_cycle_collect," + this.totalCCTime + "\n";
report += "__end_cc_report\n";
}
var now = (new Date()).getTime(); // eslint-disable-line mozilla/avoid-Date-timing
var now = (new Date()).getTime(); // eslint-disable-line mozilla/avoid-Date-timing
report += "__startTimestamp" + now + "__endTimestamp\n"; // timestamp for determning shutdown time, used by talos
return report;

Просмотреть файл

@ -125,7 +125,7 @@ function testScroll(target, stepSize, opt_reportFunc, opt_numSteps) {
function myNow() {
return (win.performance && win.performance.now) ?
win.performance.now() :
Date.now(); // eslint-disable-line mozilla/avoid-Date-timing
Date.now(); // eslint-disable-line mozilla/avoid-Date-timing
}
var isWindow = target.self === target;

Просмотреть файл

@ -29,7 +29,7 @@ addEventListener("load", function() {
// Next one is required by the test harness but not used
dumpLog("__startTimestamp" +
Date.now() + // eslint-disable-line mozilla/avoid-Date-timing
Date.now() + // eslint-disable-line mozilla/avoid-Date-timing
"__endTimestamp\n\n");
goQuitApplication();
});

Просмотреть файл

@ -100,7 +100,7 @@ addEventListener("TalosPowers:ParentExec:QueryEvent", function(e) {
throw new Error("TalosPowers:ParentExec may only be used with local content");
}
let uniqueMessageId = "TalosPowers:ParentExec:"
+ content.document.documentURI + Date.now() + Math.random(); // eslint-disable-line mozilla/avoid-Date-timing
+ content.document.documentURI + Date.now() + Math.random(); // eslint-disable-line mozilla/avoid-Date-timing
// Listener for the reply from the parent process
addMessageListener("TalosPowers:ParentExec:ReplyMsg", function done(reply) {
@ -122,4 +122,4 @@ addEventListener("TalosPowers:ParentExec:QueryEvent", function(e) {
command: e.detail.command,
id: uniqueMessageId
});
}, false, true); // wantsUntrusted since we're exposing to unprivileged
}, false, true); // wantsUntrusted since we're exposing to unprivileged

Просмотреть файл

@ -19,7 +19,7 @@
TalosContentProfiler.resume("dhtml test start", true).then(() => {
var container = document.getElementById("container");
var lastchild = document.getElementById("lastchild");
var start = new Date(); // eslint-disable-line mozilla/avoid-Date-timing
var start = new Date(); // eslint-disable-line mozilla/avoid-Date-timing
var i, div;
for (i = 0; i < 2000; i++) {
div = document.createElement("div");

Просмотреть файл

@ -20,7 +20,7 @@
mm.addMessageListener("TabPaint:OpenFromContent", function openFromContent() {
let target = document.getElementById("target");
let now = Date.now(); // eslint-disable-line mozilla/avoid-Date-timing
let now = Date.now(); // eslint-disable-line mozilla/avoid-Date-timing
let href = "target.html?" + now;
target.href = href;
target.click();

Просмотреть файл

@ -2,11 +2,11 @@
* http://creativecommons.org/publicdomain/zero/1.0/ */
function run_test() {
do_check_matches({x: 1}, {}); // fail: all pattern props required
do_check_matches({x: 1}, {x: 2}); // fail: values must match
do_check_matches({x: 1}, {}); // fail: all pattern props required
do_check_matches({x: 1}, {x: 2}); // fail: values must match
do_check_matches({x: undefined}, {});
// 'length' property counts, even if non-enumerable.
do_check_matches([3, 4, 5], [3, 5, 5]); // fail; value doesn't match
do_check_matches([3, 4, 5], [3, 5, 5]); // fail; value doesn't match
do_check_matches([3, 4, 5], [3, 4, 5, 6]);// fail; length doesn't match
}

Просмотреть файл

@ -249,7 +249,7 @@ function appendButton(aP, aTitle, aOnClick, aText, aId) {
function appendHiddenFileInput(aP, aId, aChangeListener) {
let input = appendElementWithText(aP, "input", "hidden", "");
input.type = "file";
input.id = aId; // used in testing
input.id = aId; // used in testing
input.addEventListener("change", aChangeListener);
return input;
}
@ -325,7 +325,7 @@ function onLoad() {
let label1 = appendElementWithText(labelDiv1, "label", "");
gVerbose = appendElement(label1, "input", "");
gVerbose.type = "checkbox";
gVerbose.id = "verbose"; // used for testing
gVerbose.id = "verbose"; // used for testing
appendTextNode(label1, "verbose");
const kEllipsis = "\u2026";
@ -859,7 +859,7 @@ function diffDReportMaps(aDReportMap1, aDReportMap2) {
r2_amount = r2._amount;
r2_nMerged = r2._nMerged;
delete aDReportMap2[processPath];
presence = undefined; // represents that it's present in both
presence = undefined; // represents that it's present in both
} else {
r2_amount = 0;
r2_nMerged = 0;
@ -1400,7 +1400,7 @@ function appendWarningElements(aP, aHasKnownHeapAllocated,
appendElementWithText(div, "p", "",
"This indicates a defect in one or more memory reporters. The " +
"invalid values are highlighted.\n\n");
gUnsafePathsWithInvalidValuesForThisProcess = []; // reset for the next process
gUnsafePathsWithInvalidValuesForThisProcess = []; // reset for the next process
}
}
@ -1475,7 +1475,7 @@ function appendProcessAboutMemoryElements(aP, aN, aProcess, aTrees,
appendTreeElements(pre, t, aProcess, "");
delete aTrees[treeName];
}
appendTextNode(aP, "\n"); // gives nice spacing when we copy and paste
appendTextNode(aP, "\n"); // gives nice spacing when we copy and paste
}
// Fill in and sort all the non-degenerate other trees.
@ -1509,14 +1509,14 @@ function appendProcessAboutMemoryElements(aP, aN, aProcess, aTrees,
for (let i = 0; i < otherTrees.length; i++) {
let t = otherTrees[i];
appendTreeElements(pre, t, aProcess, "");
appendTextNode(pre, "\n"); // blank lines after non-degenerate trees
appendTextNode(pre, "\n"); // blank lines after non-degenerate trees
}
for (let i = 0; i < otherDegenerates.length; i++) {
let t = otherDegenerates[i];
let padText = pad("", maxStringLength - t.toString().length, " ");
appendTreeElements(pre, t, aProcess, padText);
}
appendTextNode(aP, "\n"); // gives nice spacing when we copy and paste
appendTextNode(aP, "\n"); // gives nice spacing when we copy and paste
// Add any warnings about inaccuracies in the "explicit" tree due to platform
// limitations. These must be computed after generating all the text. The
@ -1539,8 +1539,8 @@ function appendProcessAboutMemoryElements(aP, aN, aProcess, aTrees,
* @return A boolean.
*/
function hasNegativeSign(aN) {
if (aN === 0) { // this succeeds for 0 and -0
return 1 / aN === -Infinity; // this succeeds for -0
if (aN === 0) { // this succeeds for 0 and -0
return 1 / aN === -Infinity; // this succeeds for -0
}
return aN < 0;
}
@ -1773,14 +1773,14 @@ function expandPathToThisElement(aElement) {
if (aElement.classList.contains("kids")) {
// Unhide the kids.
aElement.classList.remove("hidden");
expandPathToThisElement(aElement.previousSibling); // hasKids
expandPathToThisElement(aElement.previousSibling); // hasKids
} else if (aElement.classList.contains("hasKids")) {
// Change the separator to '--'.
let sepSpan = aElement.childNodes[2];
assertClassListContains(sepSpan, "mrSep");
sepSpan.textContent = kShowKidsSep;
expandPathToThisElement(aElement.parentNode); // kids or pre.entries
expandPathToThisElement(aElement.parentNode); // kids or pre.entries
} else {
assertClassListContains(aElement, "entries");

Просмотреть файл

@ -2331,15 +2331,15 @@ function run_readstring_tests(library) {
// Test of all posible invalid encoded sequence
let invalid_string = ctypes.unsigned_char.array(27)();
invalid_string[0] = 0x80; // 10000000
invalid_string[1] = 0xD0; // 11000000 01110100
invalid_string[0] = 0x80; // 10000000
invalid_string[1] = 0xD0; // 11000000 01110100
invalid_string[2] = 0x74;
invalid_string[3] = 0xE0; // 11100000 01110100
invalid_string[3] = 0xE0; // 11100000 01110100
invalid_string[4] = 0x74;
invalid_string[5] = 0xE0; // 11100000 10100000 01110100
invalid_string[5] = 0xE0; // 11100000 10100000 01110100
invalid_string[6] = 0xA0;
invalid_string[7] = 0x74;
invalid_string[8] = 0xE0; // 11100000 10000000 01110100
invalid_string[8] = 0xE0; // 11100000 10000000 01110100
invalid_string[9] = 0x80;
invalid_string[10] = 0x74;
invalid_string[11] = 0xF0; // 11110000 01110100
@ -2359,14 +2359,14 @@ function run_readstring_tests(library) {
invalid_string[25] = 0x74;
invalid_string[26] = 0x00;
let invalid_result = invalid_string.readStringReplaceMalformed();
do_check_eq(0xFFFD, invalid_result.charCodeAt(0)); // 10000000
do_check_eq(0xFFFD, invalid_result.charCodeAt(1)); // 11000000 01110100
do_check_eq(0xFFFD, invalid_result.charCodeAt(0)); // 10000000
do_check_eq(0xFFFD, invalid_result.charCodeAt(1)); // 11000000 01110100
do_check_eq(0x74, invalid_result.charCodeAt(2));
do_check_eq(0xFFFD, invalid_result.charCodeAt(3)); // 11100000 01110100
do_check_eq(0xFFFD, invalid_result.charCodeAt(3)); // 11100000 01110100
do_check_eq(0x74, invalid_result.charCodeAt(4));
do_check_eq(0xFFFD, invalid_result.charCodeAt(5)); // 11100000 10100000 01110100
do_check_eq(0xFFFD, invalid_result.charCodeAt(5)); // 11100000 10100000 01110100
do_check_eq(0x74, invalid_result.charCodeAt(6));
do_check_eq(0xFFFD, invalid_result.charCodeAt(7)); // 11100000 10000000 01110100
do_check_eq(0xFFFD, invalid_result.charCodeAt(7)); // 11100000 10000000 01110100
do_check_eq(0xFFFD, invalid_result.charCodeAt(8));
do_check_eq(0x74, invalid_result.charCodeAt(9));
do_check_eq(0xFFFD, invalid_result.charCodeAt(10)); // 11110000 01110100
@ -2384,11 +2384,11 @@ function run_readstring_tests(library) {
// Test decoding of UTF-8 and CESU-8
let utf8_cesu8_string = ctypes.unsigned_char.array(10)();
utf8_cesu8_string[0] = 0xF0; // U+10400 in UTF-8
utf8_cesu8_string[0] = 0xF0; // U+10400 in UTF-8
utf8_cesu8_string[1] = 0x90;
utf8_cesu8_string[2] = 0x90;
utf8_cesu8_string[3] = 0x80;
utf8_cesu8_string[4] = 0xED; // U+10400 in CESU-8
utf8_cesu8_string[4] = 0xED; // U+10400 in CESU-8
utf8_cesu8_string[5] = 0xA0;
utf8_cesu8_string[6] = 0x81;
utf8_cesu8_string[7] = 0xED;

Просмотреть файл

@ -828,7 +828,7 @@ this.MessageChannel = {
Cu.reportError(e);
return Promise.reject(e);
}
return Promise.resolve(); // Not expecting any reply.
return Promise.resolve(); // Not expecting any reply.
}
let broker = this.responseManagers.get(target);

Просмотреть файл

@ -36,7 +36,7 @@ async function checkClipboardHasTestImage(imageType) {
canvas.width = 1;
canvas.height = 1;
let ctx = canvas.getContext("2d");
ctx.drawImage(img, 0, 0); // Draw without scaling.
ctx.drawImage(img, 0, 0); // Draw without scaling.
let [r, g, b, a] = ctx.getImageData(0, 0, 1, 1).data;
let expectedColor;
if (imageType === "png") {
@ -76,7 +76,7 @@ async function checkClipboardHasTestImage(imageType) {
resolve();
}, {once: true});
document.execCommand("paste"); // requires clipboardWrite permission.
document.execCommand("paste"); // requires clipboardWrite permission.
});
// When image data is copied, its first frame is decoded and exported to the
@ -137,7 +137,7 @@ add_task(async function test_without_clipboard_permission() {
add_task(async function test_copy_png() {
if (AppConstants.platform === "android") {
return; // Android does not support images on the clipboard.
return; // Android does not support images on the clipboard.
}
let extension = ExtensionTestUtils.loadExtension({
async background() {
@ -163,7 +163,7 @@ add_task(async function test_copy_png() {
add_task(async function test_copy_jpeg() {
if (AppConstants.platform === "android") {
return; // Android does not support images on the clipboard.
return; // Android does not support images on the clipboard.
}
let extension = ExtensionTestUtils.loadExtension({
async background() {

Просмотреть файл

@ -63,7 +63,7 @@ add_task(async function test_contentscript() {
// Add an "unload" listener so that we don't put the window in the
// bfcache. This way it gets destroyed immediately upon navigation.
win.addEventListener("unload", function() {}); // eslint-disable-line mozilla/balanced-listeners
win.addEventListener("unload", function() {}); // eslint-disable-line mozilla/balanced-listeners
win.location = "http://example.com";
await extension.awaitMessage("disconnected");

Просмотреть файл

@ -19,7 +19,7 @@
function sendMessage_background() {
browser.runtime.onMessage.addListener((msg, sender, sendResponse) => {
browser.test.assertEq("from frame", msg, "Expected message from frame");
sendResponse("msg from back"); // Should not throw or anything like that.
sendResponse("msg from back"); // Should not throw or anything like that.
delayedNotifyPass("Received sendMessage from closing frame");
});
}

Просмотреть файл

@ -14,7 +14,7 @@ const TXT_LEN = 46;
const HTML_FILE = "file_download.html";
const HTML_URL = BASE + "/" + HTML_FILE;
const HTML_LEN = 117;
const BIG_LEN = 1000; // something bigger both TXT_LEN and HTML_LEN
const BIG_LEN = 1000; // something bigger both TXT_LEN and HTML_LEN
function backgroundScript() {
let complete = new Map();

Просмотреть файл

@ -238,7 +238,7 @@ add_task(async function testAsyncResults() {
return Promise.resolve(2);
},
});
if (!isChromeCompat) { // No promises for chrome.
if (!isChromeCompat) { // No promises for chrome.
do_print("testnamespace.async_required should be a Promise");
let promise = testnamespace.async_required();
do_check_true(promise instanceof context.cloneScope.Promise);
@ -269,7 +269,7 @@ add_task(async function testAsyncResults() {
async_optional() { return makeError("TWO"); },
});
if (!isChromeCompat) { // No promises for chrome.
if (!isChromeCompat) { // No promises for chrome.
await Assert.rejects(testnamespace.async_required(), /ONE/,
"should reject testnamespace.async_required()").catch(() => {});
await Assert.rejects(testnamespace.async_optional(), /TWO/,

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше