Merge mozilla-inbound to m-c a=merge CLOSED TREE

This commit is contained in:
Wes Kocher 2015-09-16 10:52:53 -07:00
Родитель d91b7b424c 4561f6d61c
Коммит 5b879dacff
3035 изменённых файлов: 14601 добавлений и 15894 удалений

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

@ -106,6 +106,13 @@ DocAccessibleParent::RecvHideEvent(const uint64_t& aRootID)
MOZ_DIAGNOSTIC_ASSERT(CheckDocTree());
// We shouldn't actually need this because mAccessibles shouldn't have an
// entry for the document itself, but it doesn't hurt to be explicit.
if (!aRootID) {
NS_ERROR("trying to hide entire document?");
return false;
}
ProxyEntry* rootEntry = mAccessibles.GetEntry(aRootID);
if (!rootEntry) {
NS_ERROR("invalid root being removed!");

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

@ -104,7 +104,7 @@ public:
void RemoveAccessible(ProxyAccessible* aAccessible)
{
MOZ_ASSERT(mAccessibles.GetEntry(aAccessible->ID()));
MOZ_DIAGNOSTIC_ASSERT(mAccessibles.GetEntry(aAccessible->ID()));
mAccessibles.RemoveEntry(aAccessible->ID());
}

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

@ -21,6 +21,7 @@ namespace a11y {
void
ProxyAccessible::Shutdown()
{
MOZ_DIAGNOSTIC_ASSERT(!IsDoc());
NS_ASSERTION(!mOuterDoc, "Why do we still have a child doc?");
// XXX Ideally this wouldn't be necessary, but it seems OuterDoc accessibles

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

@ -2,8 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
let Ci = Components.interfaces;
let Cu = Components.utils;
var Ci = Components.interfaces;
var Cu = Components.utils;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, 'Services',

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

@ -32,7 +32,7 @@ XPCOMUtils.defineLazyModuleGetter(this, 'States', // jshint ignore:line
this.EXPORTED_SYMBOLS = ['UtteranceGenerator', 'BrailleGenerator']; // jshint ignore:line
let OutputGenerator = {
var OutputGenerator = {
defaultOutputOrder: OUTPUT_DESC_LAST,

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

@ -29,7 +29,7 @@ const MOUSE_ID = 'mouse';
// Synthesized touch ID.
const SYNTH_ID = -1;
let PointerRelay = { // jshint ignore:line
var PointerRelay = { // jshint ignore:line
/**
* A mapping of events we should be intercepting. Entries with a value of
* |true| are used for compiling high-level gesture events. Entries with a

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

@ -24,7 +24,7 @@ XPCOMUtils.defineLazyModuleGetter(this, 'States', // jshint ignore:line
XPCOMUtils.defineLazyModuleGetter(this, 'Prefilters', // jshint ignore:line
'resource://gre/modules/accessibility/Constants.jsm');
let gSkipEmptyImages = new PrefCache('accessibility.accessfu.skip_empty_images');
var gSkipEmptyImages = new PrefCache('accessibility.accessfu.skip_empty_images');
function BaseTraversalRule(aRoles, aMatchFunc, aPreFilter, aContainerRule) {
this._explicitMatchRoles = new Set(aRoles);

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

@ -2,8 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
let Ci = Components.interfaces;
let Cu = Components.utils;
var Ci = Components.interfaces;
var Cu = Components.utils;
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
XPCOMUtils.defineLazyModuleGetter(this, 'Logger',
@ -23,8 +23,8 @@ XPCOMUtils.defineLazyModuleGetter(this, 'States',
Logger.info('content-script.js', content.document.location);
let eventManager = null;
let contentControl = null;
var eventManager = null;
var contentControl = null;
function forwardToParent(aMessage) {
// XXX: This is a silly way to make a deep copy

10
addon-sdk/source/app-extension/bootstrap.js поставляемый
Просмотреть файл

@ -34,12 +34,12 @@ const REASON = [ 'unknown', 'startup', 'shutdown', 'enable', 'disable',
const bind = Function.call.bind(Function.bind);
let loader = null;
let unload = null;
let cuddlefishSandbox = null;
let nukeTimer = null;
var loader = null;
var unload = null;
var cuddlefishSandbox = null;
var nukeTimer = null;
let resourceDomains = [];
var resourceDomains = [];
function setResourceSubstitution(domain, uri) {
resourceDomains.push(domain);
resourceHandler.setSubstitution(domain, uri);

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

@ -7,7 +7,7 @@ const { Toolbar } = require("sdk/ui/toolbar");
const { Frame } = require("sdk/ui/frame");
const { ActionButton } = require("sdk/ui/button/action");
let button = new ActionButton({
var button = new ActionButton({
id: "button",
label: "send!",
icon: "./favicon.ico",
@ -18,7 +18,7 @@ let button = new ActionButton({
}
});
let frame = new Frame({
var frame = new Frame({
url: "./index.html",
onAttach: () => {
console.log("frame was attached");
@ -35,7 +35,7 @@ let frame = new Frame({
event.source.postMessage("pong!", event.source.origin);
}
});
let toolbar = new Toolbar({
var toolbar = new Toolbar({
items: [frame],
title: "Addon Demo",
hidden: false,

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

@ -15,7 +15,7 @@ module.metadata = {
const { add, iterator } = require("../sdk/lang/weak-set");
const { curry } = require("../sdk/lang/functional");
let id = 0;
var id = 0;
const ports = new WeakMap();
// Takes `nsIFrameMessageManager` and `MessagePort` instances

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

@ -13,7 +13,7 @@ const PATH = __URI__.replace('framescript/FrameScriptManager.jsm', '');
// Builds a unique loader ID for this runtime. We prefix with the SDK path so
// overriden versions of the SDK don't conflict
let LOADER_ID = 0;
var LOADER_ID = 0;
this.getNewLoaderID = () => {
return PATH + ":" + LOADER_ID++;
}

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

@ -18,7 +18,7 @@ const PATH = __URI__.replace('framescript/content.jsm', '');
const { Loader } = Cu.import(PATH + 'toolkit/loader.js', {});
// one Loader instance per addon (per @loader/options to be precise)
let addons = new Map();
var addons = new Map();
// Tell the parent that a new process is ready
cpmm.sendAsyncMessage('sdk/remote/process/start', {
@ -67,7 +67,7 @@ cpmm.addMessageListener('sdk/remote/process/unload', ({ data: { loaderID, reason
})
let frames = new Set();
var frames = new Set();
this.registerContentFrame = contentFrame => {
contentFrame.addEventListener("unload", () => {

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

@ -8,19 +8,19 @@ module.metadata = {
'stability': 'experimental'
};
let { request: hostReq, response: hostRes } = require('./host');
let { defer: async } = require('../lang/functional');
let { defer } = require('../core/promise');
let { emit: emitSync, on, off } = require('../event/core');
let { uuid } = require('../util/uuid');
let emit = async(emitSync);
var { request: hostReq, response: hostRes } = require('./host');
var { defer: async } = require('../lang/functional');
var { defer } = require('../core/promise');
var { emit: emitSync, on, off } = require('../event/core');
var { uuid } = require('../util/uuid');
var emit = async(emitSync);
// Map of IDs to deferreds
let requests = new Map();
var requests = new Map();
// May not be necessary to wrap this in `async`
// once promises are async via bug 881047
let receive = async(function ({data, id, error}) {
var receive = async(function ({data, id, error}) {
let request = requests.get(id);
if (request) {
if (error) request.reject(error);

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

@ -14,10 +14,10 @@ const { defer } = require("../core/promise");
const { when: unload } = require("../system/unload");
const cfxArgs = require("../test/options");
let addonPrincipal = Cc["@mozilla.org/systemprincipal;1"].
var addonPrincipal = Cc["@mozilla.org/systemprincipal;1"].
createInstance(Ci.nsIPrincipal);
let hiddenWindow = getHiddenWindow();
var hiddenWindow = getHiddenWindow();
if (cfxArgs.parseable) {
console.info("hiddenWindow document.documentURI:" +
@ -29,14 +29,14 @@ if (cfxArgs.parseable) {
// Once Bug 565388 is fixed and shipped we'll be able to make invisible,
// permanent docShells. Meanwhile we create hidden top level window and
// use it's docShell.
let frame = makeFrame(hiddenWindow.document, {
var frame = makeFrame(hiddenWindow.document, {
nodeName: "iframe",
namespaceURI: "http://www.w3.org/1999/xhtml",
allowJavascript: true,
allowPlugins: true
})
let docShell = getDocShell(frame);
let eventTarget = docShell.chromeEventHandler;
var docShell = getDocShell(frame);
var eventTarget = docShell.chromeEventHandler;
// We need to grant docShell system principals in order to load XUL document
// from data URI into it.
@ -45,12 +45,12 @@ docShell.createAboutBlankContentViewer(addonPrincipal);
// Get a reference to the DOM window of the given docShell and load
// such document into that would allow us to create XUL iframes, that
// are necessary for hidden frames etc..
let window = docShell.contentViewer.DOMDocument.defaultView;
var window = docShell.contentViewer.DOMDocument.defaultView;
window.location = "data:application/vnd.mozilla.xul+xml;charset=utf-8,<window/>";
// Create a promise that is delivered once add-on window is interactive,
// used by add-on runner to defer add-on loading until window is ready.
let { promise, resolve } = defer();
var { promise, resolve } = defer();
eventTarget.addEventListener("DOMContentLoaded", function handler(event) {
eventTarget.removeEventListener("DOMContentLoaded", handler, false);
resolve();

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

@ -57,13 +57,13 @@ const kFlavorMap = [
{ short: "image", long: "image/png" }
];
let clipboardService = Cc["@mozilla.org/widget/clipboard;1"].
var clipboardService = Cc["@mozilla.org/widget/clipboard;1"].
getService(Ci.nsIClipboard);
let clipboardHelper = Cc["@mozilla.org/widget/clipboardhelper;1"].
var clipboardHelper = Cc["@mozilla.org/widget/clipboardhelper;1"].
getService(Ci.nsIClipboardHelper);
let imageTools = Cc["@mozilla.org/image/tools;1"].
var imageTools = Cc["@mozilla.org/image/tools;1"].
getService(Ci.imgITools);
exports.set = function(aData, aDataType) {

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

@ -18,7 +18,7 @@ const DEFAULT_LOG_LEVEL = "error";
const ADDON_LOG_LEVEL_PREF = "extensions." + self.id + ".sdk.console.logLevel";
const SDK_LOG_LEVEL_PREF = "extensions.sdk.console.logLevel";
let logLevel = DEFAULT_LOG_LEVEL;
var logLevel = DEFAULT_LOG_LEVEL;
function setLogLevel() {
logLevel = prefs.get(ADDON_LOG_LEVEL_PREF,
prefs.get(SDK_LOG_LEVEL_PREF,
@ -26,7 +26,7 @@ function setLogLevel() {
}
setLogLevel();
let logLevelObserver = {
var logLevelObserver = {
QueryInterface: function(iid) {
if (!iid.equals(Ci.nsIObserver) &&
!iid.equals(Ci.nsISupportsWeakReference) &&
@ -38,7 +38,7 @@ let logLevelObserver = {
setLogLevel();
}
};
let branch = Cc["@mozilla.org/preferences-service;1"].
var branch = Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefService).
getBranch(null);
branch.addObserver(ADDON_LOG_LEVEL_PREF, logLevelObserver, true);

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

@ -96,7 +96,7 @@ const NON_PAGE_CONTEXT_ELTS = [
// List all editable types of inputs. Or is it better to have a list
// of non-editable inputs?
let editableInputs = {
var editableInputs = {
email: true,
number: true,
password: true,
@ -107,9 +107,9 @@ let editableInputs = {
url: true
};
let CONTEXTS = {};
var CONTEXTS = {};
let Context = Class({
var Context = Class({
initialize: function(id) {
this.id = id;
},
@ -250,7 +250,7 @@ function instantiateContext({ id, type, args }) {
return new CONTEXTS[type](id, ...args);
}
let ContextWorker = Class({
var ContextWorker = Class({
implements: [ WorkerChild ],
// Calls the context workers context listeners and returns the first result
@ -304,7 +304,7 @@ function getItemWorkerForWindow(item, window) {
// A very simple remote proxy for every item. It's job is to provide data for
// the main process to use to determine visibility state and to call into
// content scripts when clicked.
let RemoteItem = Class({
var RemoteItem = Class({
initialize: function(options, manager) {
this.id = options.id;
this.contexts = [instantiateContext(c) for (c of options.contexts)];
@ -362,7 +362,7 @@ let RemoteItem = Class({
exports.RemoteItem = RemoteItem;
// Holds remote items for this frame.
let keepAlive = new Map();
var keepAlive = new Map();
// Called to create remote proxies for items. If they already exist we destroy
// and recreate. This can happen if the item changes in some way or in odd
@ -386,7 +386,7 @@ process.port.on('sdk/contextmenu/destroyitems', (process, items) => {
}
});
let lastPopupNode = null;
var lastPopupNode = null;
system.on('content-contextmenu', ({ subject }) => {
let { event: { target: popupNode }, addonInfo } = subject.wrappedJSObject;

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

@ -19,14 +19,14 @@ const { events: windowEvents } = require("sdk/window/events");
// it's not observable reliably since it's not always triggered
// when closing tabs. Implementation can be imrpoved once that
// event will be necessary.
let TYPES = ["DOMContentLoaded", "load", "pageshow", "pagehide"];
var TYPES = ["DOMContentLoaded", "load", "pageshow", "pagehide"];
let insert = observe("document-element-inserted");
let windowCreate = merge([
var insert = observe("document-element-inserted");
var windowCreate = merge([
observe("content-document-global-created"),
observe("chrome-document-global-created")
]);
let create = map(windowCreate, function({target, data, type}) {
var create = map(windowCreate, function({target, data, type}) {
return { target: target.document, type: type, data: data }
});
@ -45,13 +45,13 @@ function streamEventsFrom({document}) {
}
exports.streamEventsFrom = streamEventsFrom;
let opened = windows(null, { includePrivate: true });
let state = merge(opened.map(streamEventsFrom));
var opened = windows(null, { includePrivate: true });
var state = merge(opened.map(streamEventsFrom));
let futureReady = filter(windowEvents, function({type})
var futureReady = filter(windowEvents, function({type})
type === "DOMContentLoaded");
let futureWindows = map(futureReady, function({target}) target);
let futureState = expand(futureWindows, streamEventsFrom);
var futureWindows = map(futureReady, function({target}) target);
var futureState = expand(futureWindows, streamEventsFrom);
exports.events = merge([insert, create, state, futureState]);

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

@ -11,7 +11,7 @@ const { Ci } = require("chrome");
const { dispatcher } = require("../util/dispatcher");
const { add, remove, iterator } = require("../lang/weak-set");
let getTargetWindow = dispatcher("getTargetWindow");
var getTargetWindow = dispatcher("getTargetWindow");
getTargetWindow.define(function (target) {
if (target instanceof Ci.nsIDOMWindow)
@ -24,10 +24,10 @@ getTargetWindow.define(function (target) {
exports.getTargetWindow = getTargetWindow;
let attachTo = dispatcher("attachTo");
var attachTo = dispatcher("attachTo");
exports.attachTo = attachTo;
let detachFrom = dispatcher("detatchFrom");
var detachFrom = dispatcher("detatchFrom");
exports.detachFrom = detachFrom;
function attach(modification, target) {

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

@ -32,10 +32,10 @@ const { frames, process } = require('../remote/child');
const pagemods = new Map();
const styles = new WeakMap();
let styleFor = (mod) => styles.get(mod);
var styleFor = (mod) => styles.get(mod);
// Helper functions
let modMatchesURI = (mod, uri) => mod.include.matchesAny(uri) && !mod.exclude.matchesAny(uri);
var modMatchesURI = (mod, uri) => mod.include.matchesAny(uri) && !mod.exclude.matchesAny(uri);
/**
* PageMod constructor (exported below).

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

@ -29,7 +29,7 @@ const sandboxes = new WeakMap();
require('./content-worker.js');
Then, retrieve URL of these files in the XPI:
*/
let prefix = module.uri.split('sandbox.js')[0];
var prefix = module.uri.split('sandbox.js')[0];
const CONTENT_WORKER_URL = prefix + 'content-worker.js';
const metadata = require('@loader/options').metadata;

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

@ -7,12 +7,12 @@ module.metadata = {
'stability': 'unstable'
};
let { merge } = require('../util/object');
let { data } = require('../self');
let assetsURI = data.url();
let isArray = Array.isArray;
let method = require('../../method/core');
let { uuid } = require('../util/uuid');
var { merge } = require('../util/object');
var { data } = require('../self');
var assetsURI = data.url();
var isArray = Array.isArray;
var method = require('../../method/core');
var { uuid } = require('../util/uuid');
const isAddonContent = ({ contentURL }) =>
contentURL && data.url(contentURL).startsWith(assetsURI);
@ -43,16 +43,16 @@ function getAttachEventType(model) {
}
exports.getAttachEventType = getAttachEventType;
let attach = method('worker-attach');
var attach = method('worker-attach');
exports.attach = attach;
let connect = method('worker-connect');
var connect = method('worker-connect');
exports.connect = connect;
let detach = method('worker-detach');
var detach = method('worker-detach');
exports.detach = detach;
let destroy = method('worker-destroy');
var destroy = method('worker-destroy');
exports.destroy = destroy;
function WorkerHost (workerFor) {

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

@ -130,7 +130,7 @@ function exceptions(key, value) {
}
// workers for windows in this tab
let keepAlive = new Map();
var keepAlive = new Map();
process.port.on('sdk/worker/create', (process, options) => {
options.window = getByInnerId(options.windowId);

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

@ -24,7 +24,7 @@ const { remoteRequire, processes, frames } = require('../remote/parent');
remoteRequire('sdk/content/worker-child');
const workers = new WeakMap();
let modelFor = (worker) => workers.get(worker);
var modelFor = (worker) => workers.get(worker);
const ERR_DESTROYED = "Couldn't find the worker to receive this message. " +
"The script may not be initialized yet, or may already have been unloaded.";

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

@ -61,11 +61,11 @@ const OVERFLOW_MENU_CLASS = "addon-content-menu-overflow-menu";
const OVERFLOW_POPUP_CLASS = "addon-content-menu-overflow-popup";
// Holds private properties for API objects
let internal = ns();
var internal = ns();
// A little hacky but this is the last process ID that last opened the context
// menu
let lastContextProcessId = null;
var lastContextProcessId = null;
function uuid() {
return require('./util/uuid').uuid().toString();
@ -80,7 +80,7 @@ function getScheme(spec) {
}
}
let Context = Class({
var Context = Class({
initialize: function() {
internal(this).id = uuid();
},
@ -98,7 +98,7 @@ let Context = Class({
// Matches when the context-clicked node doesn't have any of
// NON_PAGE_CONTEXT_ELTS in its ancestors
let PageContext = Class({
var PageContext = Class({
extends: Context,
serialize: function() {
@ -112,7 +112,7 @@ let PageContext = Class({
exports.PageContext = PageContext;
// Matches when there is an active selection in the window
let SelectionContext = Class({
var SelectionContext = Class({
extends: Context,
serialize: function() {
@ -127,7 +127,7 @@ exports.SelectionContext = SelectionContext;
// Matches when the context-clicked node or any of its ancestors matches the
// selector given
let SelectorContext = Class({
var SelectorContext = Class({
extends: Context,
initialize: function initialize(selector) {
@ -152,7 +152,7 @@ let SelectorContext = Class({
exports.SelectorContext = SelectorContext;
// Matches when the page url matches any of the patterns given
let URLContext = Class({
var URLContext = Class({
extends: Context,
initialize: function initialize(patterns) {
@ -183,7 +183,7 @@ let URLContext = Class({
exports.URLContext = URLContext;
// Matches when the user-supplied predicate returns true
let PredicateContext = Class({
var PredicateContext = Class({
extends: Context,
initialize: function initialize(predicate) {
@ -219,7 +219,7 @@ function removeItemFromArray(array, item) {
function stringOrNull(val) val ? String(val) : val;
// Shared option validation rules for Item, Menu, and Separator
let baseItemRules = {
var baseItemRules = {
parentMenu: {
is: ["object", "undefined"],
ok: function (v) {
@ -247,7 +247,7 @@ let baseItemRules = {
contentScriptFile: loaderContract.rules.contentScriptFile
};
let labelledItemRules = mix(baseItemRules, {
var labelledItemRules = mix(baseItemRules, {
label: {
map: stringOrNull,
is: ["string"],
@ -278,7 +278,7 @@ let labelledItemRules = mix(baseItemRules, {
});
// Additional validation rules for Item
let itemRules = mix(labelledItemRules, {
var itemRules = mix(labelledItemRules, {
data: {
map: stringOrNull,
is: ["string", "undefined", "null"]
@ -286,7 +286,7 @@ let itemRules = mix(labelledItemRules, {
});
// Additional validation rules for Menu
let menuRules = mix(labelledItemRules, {
var menuRules = mix(labelledItemRules, {
items: {
is: ["array", "undefined"],
ok: function (v) {
@ -360,7 +360,7 @@ function serializeItem(item) {
}
// All things that appear in the context menu extend this
let BaseItem = Class({
var BaseItem = Class({
initialize: function initialize() {
internal(this).id = uuid();
@ -453,7 +453,7 @@ function workerMessageReceived(process, id, args) {
}
// All things that have a label on the context menu extend this
let LabelledItem = Class({
var LabelledItem = Class({
extends: BaseItem,
implements: [ EventTarget ],
@ -513,7 +513,7 @@ let LabelledItem = Class({
}
});
let Item = Class({
var Item = Class({
extends: LabelledItem,
initialize: function initialize(options) {
@ -538,7 +538,7 @@ let Item = Class({
});
exports.Item = Item;
let ItemContainer = Class({
var ItemContainer = Class({
initialize: function initialize() {
internal(this).children = [];
},
@ -607,7 +607,7 @@ let ItemContainer = Class({
},
});
let Menu = Class({
var Menu = Class({
extends: LabelledItem,
implements: [ItemContainer],
@ -634,7 +634,7 @@ let Menu = Class({
});
exports.Menu = Menu;
let Separator = Class({
var Separator = Class({
extends: BaseItem,
initialize: function initialize(options) {
@ -650,7 +650,7 @@ let Separator = Class({
exports.Separator = Separator;
// Holds items for the content area context menu
let contentContextMenu = ItemContainer();
var contentContextMenu = ItemContainer();
exports.contentContextMenu = contentContextMenu;
function getContainerItems(container) {
@ -691,7 +691,7 @@ function countVisibleItems(nodes) {
}, 0);
}
let MenuWrapper = Class({
var MenuWrapper = Class({
initialize: function initialize(winWrapper, items, contextMenu) {
this.winWrapper = winWrapper;
this.window = winWrapper.window;
@ -1081,7 +1081,7 @@ let MenuWrapper = Class({
});
// This wraps every window that we've seen
let WindowWrapper = Class({
var WindowWrapper = Class({
initialize: function initialize(window) {
this.window = window;
this.menus = [
@ -1108,7 +1108,7 @@ let WindowWrapper = Class({
}
});
let MenuManager = {
var MenuManager = {
windowMap: new Map(),
get overflowThreshold() {

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

@ -22,7 +22,7 @@ module.metadata = {
'stability': 'unstable'
};
let promised = (function() {
var promised = (function() {
// Note: Define shortcuts and utility functions here in order to avoid
// slower property accesses and unnecessary closure creations on each
// call of this popular function.

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

@ -128,7 +128,7 @@ exports.addIterator = function addIterator(obj, keysValsGenerator) {
// Similar to typeof, except arrays, null and regexps are identified by "array" and
// "null" and "regexp", not "object".
let getTypeOf = exports.getTypeOf = function getTypeOf(val) {
var getTypeOf = exports.getTypeOf = function getTypeOf(val) {
let typ = typeof(val);
if (typ === "object") {
if (!val)
@ -158,23 +158,23 @@ function RequirementError(key, requirement) {
}
RequirementError.prototype = Object.create(Error.prototype);
let string = { is: ['string', 'undefined', 'null'] };
var string = { is: ['string', 'undefined', 'null'] };
exports.string = string;
let number = { is: ['number', 'undefined', 'null'] };
var number = { is: ['number', 'undefined', 'null'] };
exports.number = number;
let boolean = { is: ['boolean', 'undefined', 'null'] };
var boolean = { is: ['boolean', 'undefined', 'null'] };
exports.boolean = boolean;
let object = { is: ['object', 'undefined', 'null'] };
var object = { is: ['object', 'undefined', 'null'] };
exports.object = object;
let array = { is: ['array', 'undefined', 'null'] };
var array = { is: ['array', 'undefined', 'null'] };
exports.array = array;
let isTruthyType = type => !(type === 'undefined' || type === 'null');
let findTypes = v => { while (!isArray(v) && v.is) v = v.is; return v };
var isTruthyType = type => !(type === 'undefined' || type === 'null');
var findTypes = v => { while (!isArray(v) && v.is) v = v.is; return v };
function required(req) {
let types = (findTypes(req) || VALID_TYPES).filter(isTruthyType);

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

@ -36,7 +36,7 @@ const { isPrivate } = require('../private-browsing/utils');
// should not be exposed
const workers = new WeakMap();
let modelFor = (worker) => workers.get(worker);
var modelFor = (worker) => workers.get(worker);
const ERR_DESTROYED =
"Couldn't find the worker to receive this message. " +

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

@ -127,7 +127,7 @@ const makeFilters = function makeFilters(options) {
}
exports.makeFilters = makeFilters;
let loader = Loader(module);
var loader = Loader(module);
const NOT_TESTS = ['setup', 'teardown'];
var TestFinder = exports.TestFinder = function TestFinder(options) {

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

@ -33,8 +33,8 @@ const findAndRunTests = function findAndRunTests(options) {
};
exports.findAndRunTests = findAndRunTests;
let runnerWindows = new WeakMap();
let runnerTabs = new WeakMap();
var runnerWindows = new WeakMap();
var runnerTabs = new WeakMap();
const TestRunner = function TestRunner(options) {
options = options || {};

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

@ -47,7 +47,7 @@ function on(target, type, listener) {
exports.on = on;
let onceWeakMap = new WeakMap();
var onceWeakMap = new WeakMap();
/**

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

@ -10,11 +10,11 @@ module.metadata = {
const { Ci } = require("chrome");
let { emit } = require("./core");
let { when: unload } = require("../system/unload");
let listeners = new Map();
var { emit } = require("./core");
var { when: unload } = require("../system/unload");
var listeners = new Map();
let getWindowFrom = x =>
var getWindowFrom = x =>
x instanceof Ci.nsIDOMWindow ? x :
x instanceof Ci.nsIDOMDocument ? x.defaultView :
x instanceof Ci.nsIDOMNode ? x.ownerDocument.defaultView :

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

@ -7,7 +7,7 @@ module.metadata = {
"stability": "unstable"
};
let { emit, on, once, off, EVENT_TYPE_PATTERN } = require("./core");
var { emit, on, once, off, EVENT_TYPE_PATTERN } = require("./core");
// This module provides set of high order function for working with event
// streams (streams in a NodeJS style that dispatch data, end and error
@ -17,7 +17,7 @@ let { emit, on, once, off, EVENT_TYPE_PATTERN } = require("./core");
// (non property references) it keeps. This basically allows defining
// references between objects without storing the explicitly. See transform for
// more details.
let refs = (function() {
var refs = (function() {
let refSets = new WeakMap();
return function refs(target) {
if (!refSets.has(target)) refSets.set(target, new Set());

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

@ -22,8 +22,8 @@ const { fromIterator } = require("../util/array");
// This cache is used to access friend properties between functions
// without exposing them on the public API.
let cache = new Set();
let elements = new WeakMap();
var cache = new Set();
var elements = new WeakMap();
function contentLoaded(target) {
var deferred = defer();

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

@ -12,7 +12,7 @@ const { Cc, Ci } = require("chrome");
const { id } = require("./self");
// placeholder, copied from bootstrap.js
let sanitizeId = function(id){
var sanitizeId = function(id){
let uuidRe =
/^\{([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\}$/;
@ -28,13 +28,13 @@ let sanitizeId = function(id){
const PSEUDOURI = "indexeddb://" + sanitizeId(id) // https://bugzilla.mozilla.org/show_bug.cgi?id=779197
// Use XPCOM because `require("./url").URL` doesn't expose the raw uri object.
let principaluri = Cc["@mozilla.org/network/io-service;1"].
var principaluri = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService).
newURI(PSEUDOURI, null, null);
let ssm = Cc["@mozilla.org/scriptsecuritymanager;1"]
var ssm = Cc["@mozilla.org/scriptsecuritymanager;1"]
.getService(Ci.nsIScriptSecurityManager);
let principal = ssm.createCodebasePrincipal(principaluri, {});
var principal = ssm.createCodebasePrincipal(principaluri, {});
function toArray(args) {
return Array.prototype.slice.call(args);

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

@ -72,11 +72,11 @@ function accessor() {
}
}
let nsIFile = accessor();
let nsIFileInputStream = accessor();
let nsIFileOutputStream = accessor();
let nsIBinaryInputStream = accessor();
let nsIBinaryOutputStream = accessor();
var nsIFile = accessor();
var nsIFileInputStream = accessor();
var nsIFileOutputStream = accessor();
var nsIBinaryInputStream = accessor();
var nsIBinaryOutputStream = accessor();
// Just a contstant object used to signal that all of the file
// needs to be read.
@ -324,7 +324,7 @@ exports.renameSync = renameSync;
* Asynchronous rename(2). No arguments other than a possible exception are
* given to the completion callback.
*/
let rename = Async(renameSync);
var rename = Async(renameSync);
exports.rename = rename;
/**
@ -335,7 +335,7 @@ function existsSync(path) {
}
exports.existsSync = existsSync;
let exists = Async(existsSync);
var exists = Async(existsSync);
exports.exists = exists;
/**
@ -385,7 +385,7 @@ function chownSync(path, uid, gid) {
}
exports.chownSync = chownSync;
let chown = Async(chownSync);
var chown = Async(chownSync);
exports.chown = chown;
function lchownSync(path, uid, gid) {
@ -393,7 +393,7 @@ function lchownSync(path, uid, gid) {
}
exports.lchownSync = chownSync;
let lchown = Async(lchown);
var lchown = Async(lchown);
exports.lchown = lchown;
/**
@ -414,7 +414,7 @@ exports.chmodSync = chmodSync;
* Asynchronous chmod(2). No arguments other than a possible exception are
* given to the completion callback.
*/
let chmod = Async(chmodSync);
var chmod = Async(chmodSync);
exports.chmod = chmod;
/**
@ -428,7 +428,7 @@ exports.fchmodSync = fchmodSync;
* Asynchronous chmod(2). No arguments other than a possible exception are
* given to the completion callback.
*/
let fchmod = Async(fchmodSync);
var fchmod = Async(fchmodSync);
exports.fchmod = fchmod;
@ -444,7 +444,7 @@ exports.statSync = statSync;
* Asynchronous stat(2). The callback gets two arguments (err, stats) where
* stats is a `fs.Stats` object. It looks like this:
*/
let stat = Async(statSync);
var stat = Async(statSync);
exports.stat = stat;
/**
@ -461,7 +461,7 @@ exports.lstatSync = lstatSync;
* path is a symbolic link, then the link itself is stat-ed, not the file that
* it refers to.
*/
let lstat = Async(lstatSync);
var lstat = Async(lstatSync);
exports.lstat = lstat;
/**
@ -476,7 +476,7 @@ exports.fstatSync = fstatSync;
* Asynchronous fstat(2). The callback gets two arguments (err, stats) where
* stats is a fs.Stats object.
*/
let fstat = Async(fstatSync);
var fstat = Async(fstatSync);
exports.fstat = fstat;
/**
@ -491,7 +491,7 @@ exports.linkSync = linkSync;
* Asynchronous link(2). No arguments other than a possible exception are given
* to the completion callback.
*/
let link = Async(linkSync);
var link = Async(linkSync);
exports.link = link;
/**
@ -506,7 +506,7 @@ exports.symlinkSync = symlinkSync;
* Asynchronous symlink(2). No arguments other than a possible exception are
* given to the completion callback.
*/
let symlink = Async(symlinkSync);
var symlink = Async(symlinkSync);
exports.symlink = symlink;
/**
@ -521,7 +521,7 @@ exports.readlinkSync = readlinkSync;
* Asynchronous readlink(2). The callback gets two arguments
* `(error, resolvedPath)`.
*/
let readlink = Async(readlinkSync);
var readlink = Async(readlinkSync);
exports.readlink = readlink;
/**
@ -536,33 +536,33 @@ exports.realpathSync = realpathSync;
* Asynchronous realpath(2). The callback gets two arguments
* `(err, resolvedPath)`.
*/
let realpath = Async(realpathSync);
var realpath = Async(realpathSync);
exports.realpath = realpath;
/**
* Synchronous unlink(2).
*/
let unlinkSync = remove;
var unlinkSync = remove;
exports.unlinkSync = unlinkSync;
/**
* Asynchronous unlink(2). No arguments other than a possible exception are
* given to the completion callback.
*/
let unlink = Async(remove);
var unlink = Async(remove);
exports.unlink = unlink;
/**
* Synchronous rmdir(2).
*/
let rmdirSync = remove;
var rmdirSync = remove;
exports.rmdirSync = rmdirSync;
/**
* Asynchronous rmdir(2). No arguments other than a possible exception are
* given to the completion callback.
*/
let rmdir = Async(rmdirSync);
var rmdir = Async(rmdirSync);
exports.rmdir = rmdir;
/**
@ -586,7 +586,7 @@ exports.mkdirSync = mkdirSync;
* Asynchronous mkdir(2). No arguments other than a possible exception are
* given to the completion callback.
*/
let mkdir = Async(mkdirSync);
var mkdir = Async(mkdirSync);
exports.mkdir = mkdir;
/**
@ -615,7 +615,7 @@ exports.readdirSync = readdirSync;
* gets two arguments `(error, files)` where `files` is an array of the names
* of the files in the directory excluding `"."` and `".."`.
*/
let readdir = Async(readdirSync);
var readdir = Async(readdirSync);
exports.readdir = readdir;
/**
@ -641,7 +641,7 @@ exports.closeSync = closeSync;
* Asynchronous close(2). No arguments other than a possible exception are
* given to the completion callback.
*/
let close = Async(closeSync);
var close = Async(closeSync);
exports.close = close;
/**
@ -678,7 +678,7 @@ exports.openSync = openSync;
* `"r", "r+", "w", "w+", "a"`, or `"a+"`. mode defaults to `0666`.
* The callback gets two arguments `(error, fd).
*/
let open = Async(openSync);
var open = Async(openSync);
exports.open = open;
/**
@ -895,7 +895,7 @@ function utimesSync(path, atime, mtime) {
}
exports.utimesSync = utimesSync;
let utimes = Async(utimesSync);
var utimes = Async(utimesSync);
exports.utimes = utimes;
function futimesSync(fd, atime, mtime, callback) {
@ -903,7 +903,7 @@ function futimesSync(fd, atime, mtime, callback) {
}
exports.futimesSync = futimesSync;
let futimes = Async(futimesSync);
var futimes = Async(futimesSync);
exports.futimes = futimes;
function fsyncSync(fd, atime, mtime, callback) {
@ -911,7 +911,7 @@ function fsyncSync(fd, atime, mtime, callback) {
}
exports.fsyncSync = fsyncSync;
let fsync = Async(fsyncSync);
var fsync = Async(fsyncSync);
exports.fsync = fsync;

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

@ -35,7 +35,7 @@ const threadManager = Cc["@mozilla.org/thread-manager;1"].
const eventTarget = Cc["@mozilla.org/network/stream-transport-service;1"].
getService(Ci.nsIEventTarget);
let isFunction = value => typeof(value) === "function"
var isFunction = value => typeof(value) === "function"
function accessor() {
let map = new WeakMap();
@ -123,10 +123,10 @@ const Stream = Class({
exports.Stream = Stream;
let nsIStreamListener = accessor();
let nsIInputStreamPump = accessor();
let nsIAsyncInputStream = accessor();
let nsIBinaryInputStream = accessor();
var nsIStreamListener = accessor();
var nsIInputStreamPump = accessor();
var nsIAsyncInputStream = accessor();
var nsIBinaryInputStream = accessor();
const StreamListener = Class({
initialize: function(stream) {
@ -216,10 +216,10 @@ exports.InputStream = InputStream;
let nsIRequestObserver = accessor();
let nsIAsyncOutputStream = accessor();
let nsIAsyncStreamCopier = accessor();
let nsIMultiplexInputStream = accessor();
var nsIRequestObserver = accessor();
var nsIAsyncOutputStream = accessor();
var nsIAsyncStreamCopier = accessor();
var nsIMultiplexInputStream = accessor();
const RequestObserver = Class({
initialize: function(stream) {

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

@ -13,7 +13,7 @@ const properties = require("./l10n/properties/core");
const { getRulesForLocale } = require("./l10n/plural-rules");
// Retrieve the plural mapping function
let pluralMappingFunction = getRulesForLocale(json.language()) ||
var pluralMappingFunction = getRulesForLocale(json.language()) ||
getRulesForLocale("en");
exports.get = function get(k) {

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

@ -10,7 +10,7 @@ module.metadata = {
const { processes, remoteRequire } = require("../remote/parent");
remoteRequire("sdk/content/l10n-html");
let enabled = false;
var enabled = false;
function enable() {
if (!enabled) {
processes.port.emit("sdk/l10n/html/enable");

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

@ -7,8 +7,8 @@ module.metadata = {
"stability": "unstable"
};
let usingJSON = false;
let hash = {}, bestMatchingLocale = null;
var usingJSON = false;
var hash = {}, bestMatchingLocale = null;
try {
let data = require("@l10n/data");
hash = data.hash;

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

@ -139,10 +139,10 @@ function isArguments(value) {
}
exports.isArguments = isArguments;
let isMap = value => Object.prototype.toString.call(value) === "[object Map]"
var isMap = value => Object.prototype.toString.call(value) === "[object Map]"
exports.isMap = isMap;
let isSet = value => Object.prototype.toString.call(value) === "[object Set]"
var isSet = value => Object.prototype.toString.call(value) === "[object Set]"
exports.isSet = isSet;
/**

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

@ -21,8 +21,8 @@ function makeGetterFor(Type) {
}
}
let getLookupFor = makeGetterFor(WeakMap);
let getRefsFor = makeGetterFor(Set);
var getLookupFor = makeGetterFor(WeakMap);
var getRefsFor = makeGetterFor(Set);
function add(target, value) {
if (has(target, value))

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

@ -25,13 +25,13 @@ remoteRequire('sdk/content/page-mod');
const pagemods = new Map();
const workers = new Map();
const models = new WeakMap();
let modelFor = (mod) => models.get(mod);
let workerFor = (mod) => workers.get(mod)[0];
var modelFor = (mod) => models.get(mod);
var workerFor = (mod) => workers.get(mod)[0];
// Helper functions
let isRegExpOrString = (v) => isRegExp(v) || typeof v === 'string';
var isRegExpOrString = (v) => isRegExp(v) || typeof v === 'string';
let PAGEMOD_ID = 0;
var PAGEMOD_ID = 0;
// Validation Contracts
const modOptions = {

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

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
let { deprecateUsage } = require("../util/deprecate");
var { deprecateUsage } = require("../util/deprecate");
deprecateUsage("Module 'sdk/page-mod/match-pattern' is deprecated use 'sdk/util/match-pattern' instead");

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

@ -44,7 +44,7 @@ function pageFor(view) pages.get(view)
function viewFor(page) views.get(page)
function isDisposed (page) !views.get(page, false)
let pageContract = contract(merge({
var pageContract = contract(merge({
allow: {
is: ['object', 'undefined', 'null'],
map: function (allow) { return { script: !allow || allow.script !== false }}
@ -156,12 +156,12 @@ const Page = Class({
exports.Page = Page;
let pageEvents = streamMerge([events, streamEventsFrom(window)]);
let readyEvents = filter(pageEvents, isReadyEvent);
let formattedEvents = map(readyEvents, function({target, type}) {
var pageEvents = streamMerge([events, streamEventsFrom(window)]);
var readyEvents = filter(pageEvents, isReadyEvent);
var formattedEvents = map(readyEvents, function({target, type}) {
return { type: type, page: pageFromDoc(target) };
});
let pageReadyEvents = filter(formattedEvents, function({page, type}) {
var pageReadyEvents = filter(formattedEvents, function({page, type}) {
return getAttachEventType(page) === type});
on(pageReadyEvents, 'data', injectWorker);

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

@ -36,19 +36,19 @@ const { number, boolean, object } = require('./deprecated/api-utils');
const { Style } = require("./stylesheet/style");
const { attach, detach } = require("./content/mod");
let isRect = ({top, right, bottom, left}) => [top, right, bottom, left].
var isRect = ({top, right, bottom, left}) => [top, right, bottom, left].
some(value => isNumber(value) && !isNaN(value));
let isSDKObj = obj => obj instanceof Class;
var isSDKObj = obj => obj instanceof Class;
let rectContract = contract({
var rectContract = contract({
top: number,
right: number,
bottom: number,
left: number
});
let position = {
var position = {
is: object,
map: v => (isNil(v) || isSDKObj(v) || !isObject(v)) ? v : rectContract(v),
ok: v => isNil(v) || isSDKObj(v) || (isObject(v) && isRect(v)),
@ -57,14 +57,14 @@ let position = {
'values: top, right, bottom, left.'
}
let displayContract = contract({
var displayContract = contract({
width: number,
height: number,
focus: boolean,
position: position
});
let panelContract = contract(merge({
var panelContract = contract(merge({
// contentStyle* / contentScript* are sharing the same validation constraints,
// so they can be mostly reused, except for the messages.
contentStyle: merge(Object.create(loaderContract.rules.contentScript), {
@ -79,11 +79,11 @@ let panelContract = contract(merge({
function isDisposed(panel) !views.has(panel);
let panels = new WeakMap();
let models = new WeakMap();
let views = new WeakMap();
let workers = new WeakMap();
let styles = new WeakMap();
var panels = new WeakMap();
var models = new WeakMap();
var views = new WeakMap();
var workers = new WeakMap();
var styles = new WeakMap();
const viewFor = (panel) => views.get(panel);
const modelFor = (panel) => models.get(panel);
@ -93,7 +93,7 @@ const styleFor = (panel) => styles.get(panel);
// Utility function takes `panel` instance and makes sure it will be
// automatically hidden as soon as other panel is shown.
let setupAutoHide = new function() {
var setupAutoHide = new function() {
let refs = new WeakMap();
return function setupAutoHide(panel) {
@ -280,27 +280,27 @@ exports.Panel = Panel;
getActiveView.define(Panel, viewFor);
// Filter panel events to only panels that are create by this module.
let panelEvents = filter(events, ({target}) => panelFor(target));
var panelEvents = filter(events, ({target}) => panelFor(target));
// Panel events emitted after panel has being shown.
let shows = filter(panelEvents, ({type}) => type === "popupshown");
var shows = filter(panelEvents, ({type}) => type === "popupshown");
// Panel events emitted after panel became hidden.
let hides = filter(panelEvents, ({type}) => type === "popuphidden");
var hides = filter(panelEvents, ({type}) => type === "popuphidden");
// Panel events emitted after content inside panel is ready. For different
// panels ready may mean different state based on `contentScriptWhen` attribute.
// Weather given event represents readyness is detected by `getAttachEventType`
// helper function.
let ready = filter(panelEvents, ({type, target}) =>
var ready = filter(panelEvents, ({type, target}) =>
getAttachEventType(modelFor(panelFor(target))) === type);
// Panel event emitted when the contents of the panel has been loaded.
let readyToShow = filter(panelEvents, ({type}) => type === "DOMContentLoaded");
var readyToShow = filter(panelEvents, ({type}) => type === "DOMContentLoaded");
// Styles should be always added as soon as possible, and doesn't makes them
// depends on `contentScriptWhen`
let start = filter(panelEvents, ({type}) => type === "document-element-inserted");
var start = filter(panelEvents, ({type}) => type === "document-element-inserted");
// Forward panel show / hide events to panel's own event listeners.
on(shows, "data", ({target}) => {

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

@ -14,7 +14,7 @@ module.metadata = {
const events = require("../system/events");
const { emit } = require("../event/core");
let channel = {};
var channel = {};
function forward({ subject, type, data })
emit(channel, "data", { target: subject, type: type, data: data });

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

@ -411,7 +411,7 @@ function style(panel) {
}
exports.style = style;
let getContentFrame = panel =>
var getContentFrame = panel =>
(isOpen(panel) || isOpening(panel)) ?
panel.firstChild :
panel.backgroundFrame

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

@ -375,13 +375,13 @@ function getId (item) {
* Set up the default, root groups
*/
let defaultGroupMap = {
var defaultGroupMap = {
MENU: bmsrv.bookmarksMenuFolder,
TOOLBAR: bmsrv.toolbarFolder,
UNSORTED: bmsrv.unfiledBookmarksFolder
};
let rootGroups = new Map();
var rootGroups = new Map();
for (let i in defaultGroupMap) {
let group = Object.freeze(Group({ title: i, id: defaultGroupMap[i] }));
@ -389,7 +389,7 @@ for (let i in defaultGroupMap) {
exports[i] = group;
}
let defaults = {
var defaults = {
group: exports.UNSORTED,
index: -1
};

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

@ -27,7 +27,7 @@ const { when } = require('../system/unload');
const emitter = EventTarget();
let HISTORY_ARGS = {
var HISTORY_ARGS = {
onBeginUpdateBatch: [],
onEndUpdateBatch: [],
onClearHistory: [],
@ -40,7 +40,7 @@ let HISTORY_ARGS = {
]
};
let HISTORY_EVENTS = {
var HISTORY_EVENTS = {
onBeginUpdateBatch: 'history-start-batch',
onEndUpdateBatch: 'history-end-batch',
onClearHistory: 'history-start-clear',
@ -51,7 +51,7 @@ let HISTORY_EVENTS = {
onVisit: 'history-visit'
};
let BOOKMARK_ARGS = {
var BOOKMARK_ARGS = {
onItemAdded: [
'id', 'parentId', 'index', 'type', 'url', 'title', 'dateAdded'
],
@ -66,7 +66,7 @@ let BOOKMARK_ARGS = {
onItemVisited: ['id', 'visitId', 'time', 'transitionType', 'url', 'parentId']
};
let BOOKMARK_EVENTS = {
var BOOKMARK_EVENTS = {
onItemAdded: 'bookmark-item-added',
onItemChanged: 'bookmark-item-changed',
onItemMoved: 'bookmark-item-moved',
@ -114,10 +114,10 @@ function formatValue (type, data) {
return data;
}
let historyObserver = createObserverInstance(HISTORY_EVENTS, HISTORY_ARGS);
var historyObserver = createObserverInstance(HISTORY_EVENTS, HISTORY_ARGS);
historyService.addObserver(historyObserver, false);
let bookmarkObserver = createObserverInstance(BOOKMARK_EVENTS, BOOKMARK_ARGS);
var bookmarkObserver = createObserverInstance(BOOKMARK_EVENTS, BOOKMARK_ARGS);
bookmarkService.addObserver(bookmarkObserver, false);
when(() => {

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

@ -39,7 +39,7 @@ const {
*/
const HISTORY_QUERY = 0;
let search = function query (queries, options) {
var search = function query (queries, options) {
queries = [].concat(queries);
let emitter = EventTarget();
let queryObjs = queries.map(createQuery.bind(null, HISTORY_QUERY));

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

@ -200,7 +200,7 @@ exports.getChildren = getChildren;
* Hook into host
*/
let reqStream = filter(request, (data) => /sdk-places-bookmarks/.test(data.event));
var reqStream = filter(request, (data) => /sdk-places-bookmarks/.test(data.event));
on(reqStream, 'data', ({ event, id, data }) => {
if (!EVENT_MAP[event]) return;

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

@ -155,7 +155,7 @@ function normalize (historyObj) {
* Hook into host
*/
let reqStream = filter(request, function (data) /sdk-places-query/.test(data.event));
var reqStream = filter(request, function (data) /sdk-places-query/.test(data.event));
on(reqStream, 'data', function (e) {
if (EVENT_MAP[e.event]) EVENT_MAP[e.event](e);
});

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

@ -79,7 +79,7 @@ function getTagsByURL (message) {
* Hook into host
*/
let reqStream = filter(request, function (data) {
var reqStream = filter(request, function (data) {
return /sdk-places-tags/.test(data.event);
});

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

@ -26,7 +26,7 @@ const bmsrv = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
* TreeNodes are used to construct dependency trees
* for BookmarkItems
*/
let TreeNode = Class({
var TreeNode = Class({
initialize: function (value) {
this.value = value;
this.children = [];

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

@ -13,7 +13,7 @@ const { isWindowPrivate } = require('../window/utils');
const { isPrivateBrowsingSupported } = require('../self');
const { dispatcher } = require("../util/dispatcher");
let PrivateBrowsingUtils;
var PrivateBrowsingUtils;
// Private browsing is only supported in Fx
try {
@ -24,11 +24,11 @@ catch (e) {}
exports.isGlobalPBSupported = false;
// checks that per-window private browsing is implemented
let isWindowPBSupported = exports.isWindowPBSupported =
var isWindowPBSupported = exports.isWindowPBSupported =
!!PrivateBrowsingUtils && is('Firefox');
// checks that per-tab private browsing is implemented
let isTabPBSupported = exports.isTabPBSupported =
var isTabPBSupported = exports.isTabPBSupported =
!!PrivateBrowsingUtils && is('Fennec');
function isPermanentPrivateBrowsing() {
@ -41,7 +41,7 @@ function ignoreWindow(window) {
}
exports.ignoreWindow = ignoreWindow;
let getMode = function getMode(chromeWin) {
var getMode = function getMode(chromeWin) {
return (chromeWin !== undefined && isWindowPrivate(chromeWin));
};
exports.getMode = getMode;

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

@ -8,7 +8,7 @@ module.metadata = {
"stability": "unstable"
};
let unescape = decodeURIComponent;
var unescape = decodeURIComponent;
exports.unescape = unescape;
// encodes a string safely for application/x-www-form-urlencoded

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

@ -108,8 +108,8 @@ function makeFrameEventListener(frame, callback) {
return callback.bind(frame);
}
let FRAME_ID = 0;
let tabMap = new Map();
var FRAME_ID = 0;
var tabMap = new Map();
function frameMessageReceived({ data }) {
if (data.loaderID != loaderID)
@ -257,7 +257,7 @@ const FrameList = Class({
frame.removeEventListener(...listener.args);
}
});
let frames = exports.frames = new FrameList();
var frames = exports.frames = new FrameList();
function registerContentFrame(contentFrame) {
let frame = new Frame(contentFrame);

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

@ -30,7 +30,7 @@ const loaderModule = require('toolkit/loader');
const { getTabForBrowser } = require('../tabs/utils');
// Chose the right function for resolving relative a module id
let moduleResolve;
var moduleResolve;
if (options.isNative) {
moduleResolve = (id, requirer) => loaderModule.nodeResolve(id, requirer, { rootURI: options.rootURI });
}
@ -38,13 +38,13 @@ else {
moduleResolve = loaderModule.resolve;
}
// Build the sorted path mapping structure that resolveURI requires
let pathMapping = Object.keys(options.paths)
var pathMapping = Object.keys(options.paths)
.sort((a, b) => b.length - a.length)
.map(p => [p, options.paths[p]]);
// Load the scripts in the child processes
let { getNewLoaderID } = require('../../framescript/FrameScriptManager.jsm');
let PATH = options.paths[''];
var { getNewLoaderID } = require('../../framescript/FrameScriptManager.jsm');
var PATH = options.paths[''];
const childOptions = omit(options, ['modules', 'globals', 'resolve', 'load']);
childOptions.modules = {};
@ -66,7 +66,7 @@ const gmm = Cc['@mozilla.org/globalmessagemanager;1'].
const ns = Namespace();
let processMap = new Map();
var processMap = new Map();
function processMessageReceived({ target, data }) {
if (data.loaderID != loaderID)
@ -141,9 +141,9 @@ const Processes = Class({
return processMap.get(id);
}
});
let processes = exports.processes = new Processes();
var processes = exports.processes = new Processes();
let frameMap = new Map();
var frameMap = new Map();
function frameMessageReceived({ target, data }) {
if (data.loaderID != loaderID)
@ -241,7 +241,7 @@ const FrameList = Class({
return null;
},
});
let frames = exports.frames = new FrameList();
var frames = exports.frames = new FrameList();
// Create the module loader in any existing processes
ppmm.broadcastAsyncMessage('sdk/remote/process/load', {
@ -284,7 +284,7 @@ function processStarted({ target, data: { modulePath } }) {
});
}
let pendingFrames = new Map();
var pendingFrames = new Map();
// A new frame has been created in the remote process
function frameAttached({ target, data }) {
@ -321,7 +321,7 @@ when(reason => {
ppmm.broadcastAsyncMessage('sdk/remote/process/unload', { loaderID, reason });
});
let remoteModules = new Set();
var remoteModules = new Set();
// Ensures a module is loaded in every child process. It is safe to send
// messages to this module immediately after calling this.

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

@ -33,7 +33,7 @@ const isPrivateBrowsingSupported = 'private-browsing' in permissions &&
const uri = (path="") =>
path.includes(":") ? path : addonDataURI + path.replace(/^\.\//, "");
let preferencesBranch = ("preferences-branch" in metadata)
var preferencesBranch = ("preferences-branch" in metadata)
? metadata["preferences-branch"]
: options.preferencesBranch

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

@ -180,7 +180,7 @@ JsonStore.prototype = {
// This manages a JsonStore singleton and tailors its use to simple storage.
// The root of the JsonStore is lazy-loaded: The backing file is only read the
// first time the root's gotten.
let manager = ({
var manager = ({
jsonStore: null,
// The filename of the store, based on the profile dir and extension ID.

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

@ -52,7 +52,7 @@ exports.env = require('./system/environment').env;
* 'success' code 0. To exit with failure use `1`.
* TODO: Improve platform to actually quit with an exit code.
*/
let forcedExit = false;
var forcedExit = false;
exports.exit = function exit(code) {
if (forcedExit) {
// a forced exit was already tried
@ -91,7 +91,7 @@ exports.exit = function exit(code) {
// Adapter for nodejs's stdout & stderr:
// http://nodejs.org/api/process.html#process_process_stdout
let stdout = Object.freeze({ write: dump, end: dump });
var stdout = Object.freeze({ write: dump, end: dump });
exports.stdout = stdout;
exports.stderr = stdout;

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

@ -7,27 +7,27 @@ module.metadata = {
'stability': 'experimental'
};
let { Ci } = require('chrome');
let subprocess = require('./child_process/subprocess');
let { EventTarget } = require('../event/target');
let { Stream } = require('../io/stream');
let { on, emit, off } = require('../event/core');
let { Class } = require('../core/heritage');
let { platform } = require('../system');
let { isFunction, isArray } = require('../lang/type');
let { delay } = require('../lang/functional');
let { merge } = require('../util/object');
let { setTimeout, clearTimeout } = require('../timers');
let isWindows = platform.indexOf('win') === 0;
var { Ci } = require('chrome');
var subprocess = require('./child_process/subprocess');
var { EventTarget } = require('../event/target');
var { Stream } = require('../io/stream');
var { on, emit, off } = require('../event/core');
var { Class } = require('../core/heritage');
var { platform } = require('../system');
var { isFunction, isArray } = require('../lang/type');
var { delay } = require('../lang/functional');
var { merge } = require('../util/object');
var { setTimeout, clearTimeout } = require('../timers');
var isWindows = platform.indexOf('win') === 0;
let processes = new WeakMap();
var processes = new WeakMap();
/**
* The `Child` class wraps a subprocess command, exposes
* the stdio streams, and methods to manipulate the subprocess
*/
let Child = Class({
var Child = Class({
implements: [EventTarget],
initialize: function initialize (options) {
let child = this;

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

@ -131,10 +131,10 @@ function off(type, listener) {
exports.off = off;
// must use WeakMap to keep reference to all the WeakRefs (!), see bug 986115
let weakRefs = new WeakMap();
var weakRefs = new WeakMap();
// and we're out of beta, we're releasing on time!
let stillAlive = new Map();
var stillAlive = new Map();
on('sdk:loader:destroy', function onunload({ subject, data: reason }) {
// using logic from ./unload, to avoid a circular module reference

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

@ -8,11 +8,11 @@ module.metadata = {
"stability": "unstable"
};
let { Cc, Ci, CC } = require('chrome');
let { PlainTextConsole } = require('../console/plain-text');
let { stdout } = require('../system');
let ScriptError = CC('@mozilla.org/scripterror;1', 'nsIScriptError');
let consoleService = Cc['@mozilla.org/consoleservice;1'].getService(Ci.nsIConsoleService);
var { Cc, Ci, CC } = require('chrome');
var { PlainTextConsole } = require('../console/plain-text');
var { stdout } = require('../system');
var ScriptError = CC('@mozilla.org/scripterror;1', 'nsIScriptError');
var consoleService = Cc['@mozilla.org/consoleservice;1'].getService(Ci.nsIConsoleService);
// On windows dump does not writes into stdout so cfx can't read thous dumps.
// To workaround this issue we write to a special file from which cfx will

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

@ -40,25 +40,25 @@ function tabEventsFor(window) {
}
// Filter DOMContentLoaded events from all the browser events.
let readyEvents = filter(events, function(e) e.type === "DOMContentLoaded");
var readyEvents = filter(events, function(e) e.type === "DOMContentLoaded");
// Map DOMContentLoaded events to it's target browser windows.
let futureWindows = map(readyEvents, function(e) e.target);
var futureWindows = map(readyEvents, function(e) e.target);
// Expand all browsers that will become interactive to supported tab events
// on these windows. Result will be a tab events from all tabs of all windows
// that will become interactive.
let eventsFromFuture = expand(futureWindows, tabEventsFor);
var eventsFromFuture = expand(futureWindows, tabEventsFor);
// Above covers only windows that will become interactive in a future, but some
// windows may already be interactive so we pick those and expand to supported
// tab events for them too.
let interactiveWindows = windows("navigator:browser", { includePrivate: true }).
var interactiveWindows = windows("navigator:browser", { includePrivate: true }).
filter(isInteractive);
let eventsFromInteractive = merge(interactiveWindows.map(tabEventsFor));
var eventsFromInteractive = merge(interactiveWindows.map(tabEventsFor));
// Finally merge stream of tab events from future windows and current windows
// to cover all tab events on all windows that will open.
let allEvents = merge([eventsFromInteractive, eventsFromFuture]);
var allEvents = merge([eventsFromInteractive, eventsFromFuture]);
// Map events to Fennec format if necessary
exports.events = map(allEvents, function (event) {

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

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
'use strict';
let { ns } = require('../core/namespace');
var { ns } = require('../core/namespace');
exports.tabsNS = ns();
exports.tabNS = ns();

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

@ -9,7 +9,7 @@ const { ensure } = require('../system/unload');
const addonWindow = require('../addon/window');
const { PlainTextConsole } = require('sdk/console/plain-text');
let defaultGlobals = override(require('../system/globals'), {
var defaultGlobals = override(require('../system/globals'), {
console: console
});

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

@ -180,7 +180,7 @@ function waitUntil (predicate, delay) {
}
exports.waitUntil = waitUntil;
let cleanUI = function cleanUI() {
var cleanUI = function cleanUI() {
let { promise, resolve } = defer();
let windows = getWindows(null, { includePrivate: true });

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

@ -19,13 +19,13 @@ const prefBranch = Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefService).
QueryInterface(Ci.nsIPrefBranch);
let MIN_DELAY = 4;
var MIN_DELAY = 4;
// Try to get min timeout delay used by browser.
try { MIN_DELAY = prefBranch.getIntPref("dom.min_timeout_value"); } finally {}
// Last timer id.
let lastID = 0;
var lastID = 0;
// Sets typer either by timeout or by interval
// depending on a given type.
@ -53,9 +53,9 @@ function unsetTimer(id) {
if (timer) timer.cancel();
}
let immediates = new Map();
var immediates = new Map();
let dispatcher = _ => {
var dispatcher = _ => {
// Allow scheduling of a new dispatch loop.
dispatcher.scheduled = false;
// Take a snapshot of timer `id`'s that have being present before

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

@ -83,14 +83,14 @@ getNodeView.define(ActionButton, button =>
view.nodeFor(toWidgetId(button.id))
);
let actionButtonStateEvents = events.filter(stateEvents,
var actionButtonStateEvents = events.filter(stateEvents,
e => e.target instanceof ActionButton);
let actionButtonViewEvents = events.filter(viewEvents,
var actionButtonViewEvents = events.filter(viewEvents,
e => buttons.has(e.target));
let clickEvents = events.filter(actionButtonViewEvents, e => e.type === 'click');
let updateEvents = events.filter(actionButtonViewEvents, e => e.type === 'update');
var clickEvents = events.filter(actionButtonViewEvents, e => e.type === 'click');
var updateEvents = events.filter(actionButtonViewEvents, e => e.type === 'update');
on(clickEvents, 'data', ({target: id, window}) => {
let button = buttons.get(id);

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

@ -14,7 +14,7 @@ const isIconSet = (icons) =>
Object.keys(icons).
every(size => String(size >>> 0) === size && isLocalURL(icons[size]));
let iconSet = {
var iconSet = {
is: either(object, string),
map: v => isObject(v) ? freeze(merge({}, v)) : v,
ok: v => (isString(v) && isLocalURL(v)) || (isObject(v) && isIconSet(v)),
@ -22,30 +22,30 @@ let iconSet = {
'numeric keys / local URL values pair.'
}
let id = {
var id = {
is: string,
ok: v => /^[a-z-_][a-z0-9-_]*$/i.test(v),
msg: 'The option "id" must be a valid alphanumeric id (hyphens and ' +
'underscores are allowed).'
};
let label = {
var label = {
is: string,
ok: v => isNil(v) || v.trim().length > 0,
msg: 'The option "label" must be a non empty string'
}
let badge = {
var badge = {
is: either(string, number),
msg: 'The option "badge" must be a string or a number'
}
let badgeColor = {
var badgeColor = {
is: string,
msg: 'The option "badgeColor" must be a string'
}
let stateContract = contract({
var stateContract = contract({
label: label,
icon: iconSet,
disabled: boolean,
@ -55,7 +55,7 @@ let stateContract = contract({
exports.stateContract = stateContract;
let buttonContract = contract(merge({}, stateContract.rules, {
var buttonContract = contract(merge({}, stateContract.rules, {
id: required(id),
label: required(label),
icon: required(iconSet)

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

@ -84,14 +84,14 @@ getNodeView.define(ToggleButton, button =>
view.nodeFor(toWidgetId(button.id))
);
let toggleButtonStateEvents = events.filter(stateEvents,
var toggleButtonStateEvents = events.filter(stateEvents,
e => e.target instanceof ToggleButton);
let toggleButtonViewEvents = events.filter(viewEvents,
var toggleButtonViewEvents = events.filter(viewEvents,
e => buttons.has(e.target));
let clickEvents = events.filter(toggleButtonViewEvents, e => e.type === 'click');
let updateEvents = events.filter(toggleButtonViewEvents, e => e.type === 'update');
var clickEvents = events.filter(toggleButtonViewEvents, e => e.type === 'click');
var updateEvents = events.filter(toggleButtonViewEvents, e => e.type === 'update');
on(toggleButtonStateEvents, 'data', ({target, window, state}) => {
let id = toWidgetId(target.id);

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

@ -13,6 +13,6 @@ module.metadata = {
}
};
let channel = {};
var channel = {};
exports.events = channel;

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

@ -22,6 +22,6 @@ function memoize(f) {
};
}
let identify = method('identify');
var identify = method('identify');
identify.define(Object, memoize(function() { return uuid(); }));
exports.identify = identify;

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

@ -41,7 +41,7 @@ const sidebarNS = ns();
const WEB_PANEL_BROWSER_ID = 'web-panels-browser';
let sidebars = {};
var sidebars = {};
const Sidebar = Class({
implements: [ Disposable ],

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

@ -207,13 +207,13 @@ exports.unregister = unregister;
const isRegistered = component => has(components, component);
exports.isRegistered = isRegistered;
let tabSelect = events.filter(tabEvents, e => e.type === 'TabSelect');
let tabClose = events.filter(tabEvents, e => e.type === 'TabClose');
let windowOpen = events.filter(browserEvents, e => e.type === 'load');
let windowClose = events.filter(browserEvents, e => e.type === 'close');
var tabSelect = events.filter(tabEvents, e => e.type === 'TabSelect');
var tabClose = events.filter(tabEvents, e => e.type === 'TabClose');
var windowOpen = events.filter(browserEvents, e => e.type === 'load');
var windowClose = events.filter(browserEvents, e => e.type === 'close');
let close = events.merge([tabClose, windowClose]);
let activate = events.merge([windowOpen, tabSelect]);
var close = events.merge([tabClose, windowClose]);
var activate = events.merge([windowOpen, tabSelect]);
on(activate, 'data', ({target}) => {
let [window, tab] = isWindow(target)

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

@ -13,6 +13,6 @@ module.metadata = {
}
};
let channel = {};
var channel = {};
exports.events = channel;

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

@ -55,7 +55,7 @@ const validate = contract({
// Toolbars is a mapping between `toolbar.id` & `toolbar` instances,
// which is used to find intstance for dispatching events.
let toolbars = new Map();
var toolbars = new Map();
const Toolbar = Class({
extends: EventTarget,

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

@ -54,14 +54,14 @@ function resolveResourceURI(uri) {
return resolved;
}
let fromFilename = exports.fromFilename = function fromFilename(path) {
var fromFilename = exports.fromFilename = function fromFilename(path) {
var file = Cc['@mozilla.org/file/local;1']
.createInstance(Ci.nsILocalFile);
file.initWithPath(path);
return ios.newFileURI(file).spec;
};
let toFilename = exports.toFilename = function toFilename(url) {
var toFilename = exports.toFilename = function toFilename(url) {
var uri = newURI(url);
if (uri.scheme == "resource")
uri = newURI(resolveResourceURI(uri));
@ -300,7 +300,7 @@ const DataURL = Class({
exports.DataURL = DataURL;
let getTLD = exports.getTLD = function getTLD (url) {
var getTLD = exports.getTLD = function getTLD (url) {
let uri = newURI(url.toString());
let tld = null;
try {
@ -315,7 +315,7 @@ let getTLD = exports.getTLD = function getTLD (url) {
return tld;
};
let isValidURI = exports.isValidURI = function (uri) {
var isValidURI = exports.isValidURI = function (uri) {
try {
newURI(uri);
}

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

@ -21,7 +21,7 @@ function newURI (uri) {
}
exports.newURI = newURI;
let getURL = method('sdk/url:getURL');
var getURL = method('sdk/url:getURL');
getURL.define(String, function (url) url);
getURL.define(function (object) {
return null;

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

@ -16,7 +16,7 @@ const method = require("method/core");
// and all the XUL nodes share same type / prototype.
// Probably this is more generic and belongs some place else, but
// we can move it later once this will be relevant.
let dispatcher = hint => {
var dispatcher = hint => {
const base = method(hint);
// Make a map for storing predicate, implementation mappings.
let implementations = new Map();

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

@ -14,7 +14,7 @@ var method = require("../../method/core");
// the given `value`. If `value` has no view associated
// it returns `null`. You can implement this method for
// this type to define what the result should be for it.
let getNodeView = method("getNodeView");
var getNodeView = method("getNodeView");
getNodeView.define(x =>
x instanceof Ci.nsIDOMNode ? x :
x instanceof Ci.nsIDOMWindow ? x :
@ -22,5 +22,5 @@ getNodeView.define(x =>
exports.getNodeView = getNodeView;
exports.viewFor = getNodeView;
let getActiveView = method("getActiveView");
var getActiveView = method("getActiveView");
exports.getActiveView = getActiveView;

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

@ -27,8 +27,8 @@ function eventsFor(window) {
// In addition to observing windows that are open we also observe windows
// that are already already opened in case they're in process of loading.
let opened = windows(null, { includePrivate: true });
let currentEvents = merge(opened.map(eventsFor));
var opened = windows(null, { includePrivate: true });
var currentEvents = merge(opened.map(eventsFor));
// Register system event listeners for top level window open / close.
function rename({type, target, data}) {
@ -37,10 +37,10 @@ function rename({type, target, data}) {
rename.domwindowopened = "open";
rename.domwindowclosed = "close";
let openEvents = map(observe("domwindowopened"), rename);
let closeEvents = map(observe("domwindowclosed"), rename);
let futureEvents = expand(openEvents, function({target}) eventsFor(target));
var openEvents = map(observe("domwindowopened"), rename);
var closeEvents = map(observe("domwindowclosed"), rename);
var futureEvents = expand(openEvents, function({target}) eventsFor(target));
let channel = merge([currentEvents, futureEvents,
var channel = merge([currentEvents, futureEvents,
openEvents, closeEvents]);
exports.events = channel;

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

@ -221,7 +221,7 @@ function onFocus(window) {
}
exports.onFocus = onFocus;
let isFocused = dispatcher("window-isFocused");
var isFocused = dispatcher("window-isFocused");
isFocused.when(x => x instanceof Ci.nsIDOMWindow, (window) => {
const FM = Cc["@mozilla.org/focus-manager;1"].
getService(Ci.nsIFocusManager);

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

@ -17,7 +17,7 @@ const ERR_FENNEC_MSG = 'This method is not yet supported by Fennec, consider usi
// NOTE: On Fennec there is only one window.
let BrowserWindows = Class({
var BrowserWindows = Class({
implements: [ List ],
extends: EventTarget,
initialize: function() {

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

@ -188,7 +188,7 @@ for (let domWindow of windows()) {
addListItem(browserWindows, window);
}
let windowEventListener = (event, domWindow, ...args) => {
var windowEventListener = (event, domWindow, ...args) => {
if (ignoreWindow(domWindow))
return;

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

@ -90,7 +90,7 @@ const Tabs = Class({
return tab;
}
});
let gTabs = exports.tabs = Tabs(mainWindow);
var gTabs = exports.tabs = Tabs(mainWindow);
function tabsUnloader(event, window) {
window = window || (event && event.target);

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

@ -937,13 +937,13 @@ function Loader(options) {
};
Loader.Loader = Loader;
let isJSONURI = uri => uri.substr(-5) === '.json';
let isJSMURI = uri => uri.substr(-4) === '.jsm';
let isJSURI = uri => uri.substr(-3) === '.js';
let isAbsoluteURI = uri => uri.indexOf("resource://") >= 0 ||
var isJSONURI = uri => uri.substr(-5) === '.json';
var isJSMURI = uri => uri.substr(-4) === '.jsm';
var isJSURI = uri => uri.substr(-3) === '.js';
var isAbsoluteURI = uri => uri.indexOf("resource://") >= 0 ||
uri.indexOf("chrome://") >= 0 ||
uri.indexOf("file://") >= 0
let isRelative = id => id[0] === '.'
var isRelative = id => id[0] === '.'
const generateMap = iced(function generateMap(options, callback) {
let { rootURI, resolve, paths } = override({

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

@ -26,11 +26,11 @@ var Startup = {
};
var exports = Startup;
let gOnceInitializedDeferred = defer();
var gOnceInitializedDeferred = defer();
exports.onceInitialized = gOnceInitializedDeferred.promise;
// Set 'final-ui-startup' as default topic for unknown applications
let appStartup = 'final-ui-startup';
var appStartup = 'final-ui-startup';
if (Startup.initialized) {
gOnceInitializedDeferred.resolve()

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

@ -7,7 +7,7 @@ const Cu = Components.utils;
Cu.import("resource://gre/modules/Services.jsm");
let { log } = console;
var { log } = console;
function startup(data, reason) {
// This code allow to make all stdIO work

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

@ -8,14 +8,14 @@ self.postMessage(["equal", document.title, "Page Worker test",
"Correct page title accessed directly"]);
// get <p> directly
let p = document.getElementById("paragraph");
var p = document.getElementById("paragraph");
self.postMessage(["ok", !!p, "<p> can be accessed directly"]);
self.postMessage(["equal", p.firstChild.nodeValue,
"Lorem ipsum dolor sit amet.",
"Correct text node expected"]);
// Modify page
let div = document.createElement("div");
var div = document.createElement("div");
div.setAttribute("id", "block");
div.appendChild(document.createTextNode("Test text created"));
document.body.appendChild(div);

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

@ -92,7 +92,7 @@ function createWorker(assert, xrayWindow, contentScript, done) {
/* Examples for the `createProxyTest` uses */
let html = "<script>var documentGlobal = true</script>";
var html = "<script>var documentGlobal = true</script>";
exports["test Create Proxy Test"] = createProxyTest(html, function (helper, assert) {
// You can get access to regular `test` object in second argument of
@ -169,7 +169,7 @@ exports["test Shared To String Proxies"] = createProxyTest("", function(helper)
*/
// Ensure that postMessage is working correctly across documents with an iframe
let html = '<iframe id="iframe" name="test" src="data:text/html;charset=utf-8," />';
var html = '<iframe id="iframe" name="test" src="data:text/html;charset=utf-8," />';
exports["test postMessage"] = createProxyTest(html, function (helper, assert) {
let ifWindow = helper.xrayWindow.document.getElementById("iframe").contentWindow;
// Listen without proxies, to check that it will work in regular case
@ -199,7 +199,7 @@ exports["test postMessage"] = createProxyTest(html, function (helper, assert) {
);
});
let html = '<input id="input2" type="checkbox" />';
var html = '<input id="input2" type="checkbox" />';
exports["test Object Listener"] = createProxyTest(html, function (helper) {
helper.createWorker(
@ -255,7 +255,7 @@ exports["test Object Listener 2"] = createProxyTest("", function (helper) {
});
let html = '<input id="input" type="text" /><input id="input3" type="checkbox" />' +
var html = '<input id="input" type="text" /><input id="input3" type="checkbox" />' +
'<input id="input2" type="checkbox" />';
exports.testStringOverload = createProxyTest(html, function (helper, assert) {
@ -504,7 +504,7 @@ exports["test Document TagName"] = createProxyTest("", function (helper) {
});
let html = '<iframe id="iframe" name="test" src="data:text/html;charset=utf-8," />';
var html = '<iframe id="iframe" name="test" src="data:text/html;charset=utf-8," />';
exports["test Window Frames"] = createProxyTest(html, function (helper) {
helper.createWorker(
@ -539,7 +539,7 @@ exports["test Collections"] = createProxyTest("", function (helper) {
});
let html = '<input id="input" type="text" /><input id="input3" type="checkbox" />' +
var html = '<input id="input" type="text" /><input id="input3" type="checkbox" />' +
'<input id="input2" type="checkbox" />';
exports["test Collections 2"] = createProxyTest(html, function (helper) {
@ -656,7 +656,7 @@ exports["test Functions"] = createProxyTest("", function (helper) {
});
let html = '<input id="input2" type="checkbox" />';
var html = '<input id="input2" type="checkbox" />';
exports["test Listeners"] = createProxyTest(html, function (helper) {
helper.createWorker(
@ -790,7 +790,7 @@ exports["test Cross Domain Iframe"] = createProxyTest("", function (helper) {
});
// Bug 769006: Ensure that MutationObserver works fine with proxies
let html = '<a href="foo">link</a>';
var html = '<a href="foo">link</a>';
exports["test MutationObvserver"] = createProxyTest(html, function (helper) {
helper.createWorker(
@ -828,7 +828,7 @@ exports["test MutationObvserver"] = createProxyTest(html, function (helper) {
});
let html = '<script>' +
var html = '<script>' +
'var accessCheck = function() {' +
' assert(true, "exporting function works");' +
' try{' +

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

@ -23,7 +23,7 @@ process.port.on('sdk/test/ping', (process, key) => {
process.port.emit('sdk/test/pong', key);
});
let frameCount = 0;
var frameCount = 0;
frames.forEvery(frame => {
frameCount++;
frame.on('detach', () => {

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

@ -12,7 +12,7 @@ const { events } = require("sdk/tab/events");
const { on, off } = require("sdk/event/core");
const { resolve, defer } = require("sdk/core/promise");
let isFennec = require("sdk/system/xul-app").is("Fennec");
var isFennec = require("sdk/system/xul-app").is("Fennec");
function test(options) {
return function(assert, done) {

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

@ -33,10 +33,10 @@ const REASON = [ 'unknown', 'startup', 'shutdown', 'enable', 'disable',
const bind = Function.call.bind(Function.bind);
let loader = null;
let unload = null;
let cuddlefishSandbox = null;
let nukeTimer = null;
var loader = null;
var unload = null;
var cuddlefishSandbox = null;
var nukeTimer = null;
// Utility function that synchronously reads local resource from the given
// `uri` and returns content string.

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

@ -5,7 +5,7 @@
const { setTimeout } = require('sdk/timers');
let mainStarted = false;
var mainStarted = false;
exports.main = function main(options, callbacks) {
mainStarted = true;

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

@ -16,13 +16,13 @@ const { require: devtoolsRequire } = Cu.import("resource://gre/modules/devtools/
const { DebuggerServer } = devtoolsRequire("devtools/server/main");
const { DebuggerClient } = devtoolsRequire("devtools/toolkit/client/main");
let gClient;
let ok;
let testName = 'testDebugger';
let iframeURL = 'data:text/html;charset=utf-8,' + testName;
let TAB_URL = 'data:text/html;charset=utf-8,' + encodeURIComponent('<iframe src="' + iframeURL + '" />');
var gClient;
var ok;
var testName = 'testDebugger';
var iframeURL = 'data:text/html;charset=utf-8,' + testName;
var TAB_URL = 'data:text/html;charset=utf-8,' + encodeURIComponent('<iframe src="' + iframeURL + '" />');
TAB_URL = data.url('index.html');
let mod;
var mod;
exports.testDebugger = function(assert, done) {
ok = assert.ok.bind(assert);

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

@ -16,13 +16,13 @@ const { require: devtoolsRequire } = Cu.import("resource://gre/modules/devtools/
const { DebuggerServer } = devtoolsRequire("devtools/server/main");
const { DebuggerClient } = devtoolsRequire("devtools/toolkit/client/main");
let gClient;
let ok;
let testName = 'testDebugger';
let iframeURL = 'data:text/html;charset=utf-8,' + testName;
let TAB_URL = 'data:text/html;charset=utf-8,' + encodeURIComponent('<iframe src="' + iframeURL + '" />');
var gClient;
var ok;
var testName = 'testDebugger';
var iframeURL = 'data:text/html;charset=utf-8,' + testName;
var TAB_URL = 'data:text/html;charset=utf-8,' + encodeURIComponent('<iframe src="' + iframeURL + '" />');
TAB_URL = data.url('index.html');
let mod;
var mod;
exports.testDebugger = function(assert, done) {
ok = assert.ok.bind(assert);

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