1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-29 03:12:26 +01:00

Add missing semicolons.

This commit is contained in:
Doug Kearns
2015-05-25 23:54:56 +10:00
parent 72a4d80ad1
commit 5ab1befbf7
35 changed files with 82 additions and 84 deletions

View File

@@ -63,7 +63,7 @@ var AutoCmdHive = Class("AutoCmdHive", Contexts.Hive, {
remove: function (event, filter) {
filter = filter && String(Group.compileFilter(filter));
this._store = this._store.filter(cmd => !cmd.match(event, filter));
},
}
});
/**

View File

@@ -646,7 +646,7 @@ var Bookmarks = Module("bookmarks", {
options.add(["suggestengines"],
"Search engines used for search suggestions",
"stringlist", "google",
{ completer: function completer(context) completion.searchEngine(context, true), });
{ completer: function completer(context) completion.searchEngine(context, true) });
},
completion: function initCompletion() {

View File

@@ -198,7 +198,7 @@ var Browser = Module("browser", XPCOM(Ci.nsISupportsWeakReference, ModuleBase),
onLocationChange: util.wrapCallback(function onLocationChange(browser) {
Buffer(browser.contentWindow).locationChanged();
}),
})
}
}, {
}, {

View File

@@ -47,7 +47,7 @@ var CommandWidgets = Class("CommandWidgets", {
["hbox", { id: s + "commandline", hidden: "false", class: "dactyl-container", highlight: "Normal StatusNormal", collapsed: "true" },
["label", { id: s + "commandline-prompt", class: "dactyl-commandline-prompt plain", flex: "0", crop: "end", value: "", collapsed: "true" }],
["textbox", { id: s + "commandline-command", class: "dactyl-commandline-command plain", flex: "1", type: "text", timeout: "100",
highlight: "Events", }]]]],
highlight: "Events" }]]]],
before: [
["toolbar", { id: statusline.statusBar.id, xmlns: "xul" },
@@ -446,7 +446,7 @@ var CommandMode = Class("CommandMode", {
this.completions.clear();
if (this.history)
this.history.reset();
},
}
});
var CommandExMode = Class("CommandExMode", CommandMode, {
@@ -783,7 +783,7 @@ var CommandLine = Module("commandline", {
message.message;
this._messageHistory.add(update({ highlight: highlightGroup }, message));
return message.message;
}
};
if (flags & this.APPEND_TO_MESSAGES)
data = appendToMessages(data);

View File

@@ -1647,7 +1647,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
if (args["+purgecaches"])
cache.flush();
util.delay(() => { util.rehash(args) });
util.delay(() => { util.rehash(args); });
},
{
argCount: "0", // FIXME

View File

@@ -804,7 +804,7 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), {
this.editor.endTransaction();
this.editor = null;
}
},
}
};
Map.types["operator"] = {
preExecute: function preExecute(args) {

View File

@@ -741,7 +741,7 @@ var HintSession = Class("HintSession", CommandMode, {
updateStatusline: function _updateStatusline() {
statusline.inputBuffer = (this.escapeNumbers ? "\\" : "") +
(this.hintNumber ? this.getHintString(this.hintNumber) : "");
},
}
});
var Hints = Module("hints", {

View File

@@ -286,7 +286,7 @@ var Marks = Module("marks", {
return;
}
}
},
}
}, {
markToString: function markToString(name, mark) {
let tab = mark.tab && mark.tab.get();

View File

@@ -350,7 +350,7 @@ var Modes = Module("modes", {
if (stack && stack.pop)
for (let { obj, prop, value, test } of values(this.topOfStack.saved))
if (!test || !test(stack, prev))
dactyl.trapErrors(function () { obj[prop] = value });
dactyl.trapErrors(function () { obj[prop] = value; });
this.show();

View File

@@ -172,7 +172,7 @@ var QuickMarks = Module("quickmarks", {
quickmarks.list(args[0] || "");
}, {
argCount: "?",
completer: function (context) completion.quickmark(context),
completer: function (context) completion.quickmark(context)
});
},
completion: function initCompletion() {

View File

@@ -17,7 +17,7 @@ lazyRequire("template", ["template"]);
var callResult = function callResult(method, ...args) {
return function (result) { result[method].apply(result, args); };
}
};
var listener = function listener(action, event)
function addonListener(install) {
@@ -218,7 +218,7 @@ var Addon = Class("Addon", {
node.removeChild(node.firstChild);
DOM(node).append(isArray(xml) ? xml : DOM.DOMString(xml));
}
};
update("name", template.icon({ icon: this.iconURL }, this.name));
this.nodes.version.textContent = this.version;
@@ -431,7 +431,7 @@ var Addons = Module("addons", {
if (command.actions)
command.actions(list, this.modules);
else
list.forEach(addon => { command.action.call(this.modules, addon, args.bang) });
list.forEach(addon => { command.action.call(this.modules, addon, args.bang); });
}));
}, {
argCount: "?", // FIXME: should be "1"

View File

@@ -107,7 +107,7 @@ defineModule.dump = function dump_(...args) {
dump(String.replace(msg, /\n?$/, "\n")
.replace(/^./gm, JSMLoader.name + ": $&"));
}
}
};
defineModule.modules = [];
defineModule.time = function time(major, minor, func, self, ...args) {
let time = Date.now();
@@ -123,7 +123,7 @@ defineModule.time = function time(major, minor, func, self, ...args) {
JSMLoader.times.add(major, minor, Date.now() - time);
return res;
}
};
function endModule() {
defineModule.prefix = defineModule.prefix.slice(0, -2);
@@ -230,7 +230,7 @@ this.lazyRequire("util", ["FailedAssertion", "util"]);
if (typeof Symbol == "undefined")
this.Symbol = {
iterator: "@@iterator",
iterator: "@@iterator"
};
literal.files = {};
@@ -382,7 +382,7 @@ deprecated.warn = function warn(func, name, alternative, frame) {
if (!func.seenCaller.add(filename))
util.dactyl(func).warn([util.urlPath(filename), frame.lineNumber, " "].join(":")
+ _("warn.deprecated", name, alternative));
}
};
/**
* Iterates over all of the top-level, iterable property names of an
@@ -430,7 +430,7 @@ Object.defineProperty(RealSet.prototype, "add", {
let res = this.has(val);
Set_add.apply(this, arguments);
return res;
},
}
});
Object.defineProperty(RealSet.prototype, "difference", {
@@ -438,7 +438,7 @@ Object.defineProperty(RealSet.prototype, "difference", {
writable: true,
value: function RealSet_difference(set) {
return new RealSet(i for (i of this) if (!set.has(i)));
},
}
});
Object.defineProperty(RealSet.prototype, "intersection", {
@@ -446,7 +446,7 @@ Object.defineProperty(RealSet.prototype, "intersection", {
writable: true,
value: function RealSet_intersection(set) {
return new RealSet(i for (i of this) if (set.has(i)));
},
}
});
Object.defineProperty(RealSet.prototype, "union", {
@@ -457,7 +457,7 @@ Object.defineProperty(RealSet.prototype, "union", {
for (let item of set)
res.add(item);
return res;
},
}
});
/**
@@ -598,7 +598,7 @@ function curry(fn, length, self, acc) {
return fn.apply(self || this, args);
return curry(fn, length, self || this, args);
};
}
curried.realName = fn.realName || fn.name;
return curried;
}
@@ -607,7 +607,7 @@ var bind = function bind(meth, self, ...args) {
let func = callable(meth) ? meth : self[meth];
return apply(func, "bind", [self].concat(args));
}
};
/**
* Returns true if both arguments are functions and
@@ -787,11 +787,11 @@ function update(target) {
func.superapply = function superapply(self, args) {
let meth = Object.getPrototypeOf(target)[k];
return meth && meth.apply(self, args);
}
};
func.supercall = function supercall(self, ...args) {
return func.superapply(self, args);
}
};
}
}
@@ -927,7 +927,7 @@ Class.extend = function extend(subclass, superclass, overrides) {
if (superclass.prototype.constructor === objproto.constructor)
superclass.prototype.constructor = superclass;
}
};
/**
* Memoizes the value of a class property to the value returned by
@@ -1101,7 +1101,7 @@ Class.prototype = {
func.supercall = function supercall(self, ...args) {
return func.superapply(self, args);
}
};
}
}
@@ -1143,7 +1143,7 @@ var closureHooks = {
if (hasOwnProperty(target._closureCache, prop))
return target._closureCache[prop];
let p = target[prop]
let p = target[prop];
if (callable(p))
return target._closureCache[prop] = p.bind(target);
return p;
@@ -1213,7 +1213,7 @@ function XPCOMShim(interfaces) {
});
return (interfaces || []).reduce((shim, iface) => shim.QueryInterface(Ci[iface]),
ip.data);
};
}
let stub = Class.Property({
configurable: true,
enumerable: false,
@@ -1313,7 +1313,7 @@ Module.INIT = {
modules.dactyl.registerObservers(module);
}
}
}
};
/**
* @class Struct
@@ -1336,7 +1336,7 @@ function Struct(...args) {
const Struct = Class(className || "Struct", StructBase, {
length: args.length,
members: Ary(args).map((v, k) => [v, k]).toObject(),
members: Ary(args).map((v, k) => [v, k]).toObject()
});
args.forEach(function (name, i) {
Struct.prototype.__defineGetter__(name, function () this[i]);
@@ -1606,6 +1606,7 @@ update(iter, {
return false;
return true;
},
some: function every(iter, pred, self) {
pred = pred || util.identity;
for (let elem of iter)
@@ -1733,7 +1734,7 @@ const Iter = Class("Iter", {
"Here you go:\n\n" + Error().stack);
throw Error("Iter object used as a pre-ES6 iterator");
},
}
});
iter.Iter = Iter;
@@ -1956,7 +1957,7 @@ Object.defineProperty(Class.prototype, "closure",
if (false)
var array = Class("array", Ary, {
init: deprecated("Ary", function init() { init.superapply(arguments) })
init: deprecated("Ary", function init() { init.superapply(arguments); })
});
else
array = Ary;

View File

@@ -55,7 +55,7 @@ update(Bookmark.prototype, {
return res.reverse();
}
})
});
Bookmark.prototype.members.uri = Bookmark.prototype.members.url;
Bookmark.setter = function (key, func) this.prototype.__defineSetter__(key, func);
Bookmark.setter("url", function (val) { this.uri = isString(val) ? newURI(val) : val; });

View File

@@ -13,7 +13,7 @@ this["import"] = function import_(obj) {
for (let key of Object.getOwnPropertyNames(obj))
Object.defineProperty(res, key, Object.getOwnPropertyDescriptor(obj, key));
return res;
}
};
if (typeof TextEncoder == "undefined")
Components.utils.importGlobalProperties(["TextEncoder", "TextDecoder"]);

View File

@@ -728,7 +728,7 @@ var Buffer = Module("Buffer", {
return !b
|| a[0] == b[0] && a[1] == b[1]
|| a[0] != b[0] && a[1] != b[1];
}
};
let link = DOM("link[href][rev=canonical], \
link[href][rel=shortlink]", doc)
@@ -749,7 +749,7 @@ var Buffer = Module("Buffer", {
link[href][rel=shortlink]", this.doc)
.each(elem => {
overlay.getData(elem, "link-check",
() => [elem.href, this.pageURI.spec])
() => [elem.href, this.pageURI.spec]);
});
},
@@ -1264,7 +1264,7 @@ var Buffer = Module("Buffer", {
encoder.init(doc, "text/unicode", encoder.OutputRaw|encoder.OutputPreformatted);
OS.File.writeAtomic(file.path, encoder.encodeToString())
.then(() => { resolve([file, true]) })
.then(() => { resolve([file, true]); })
.catch(reject);
}
else {

View File

@@ -1356,7 +1356,7 @@ var Commands = Module("commands", {
}
if (complete)
var context = complete.fork(command.name).fork("opts", len);;
var context = complete.fork(command.name).fork("opts", len);
if (!complete || /(\w|^)[!\s]/.test(str))
args = command.parseArgs(args, context, { count: count, bang: bang });
@@ -1641,7 +1641,7 @@ var Commands = Module("commands", {
description: "The argument completion function",
completer: function (context) [[k, ""] for ([k, v] of iter(config.completers))],
type: CommandOption.STRING,
validator: function (arg) arg in config.completers || /^custom,/.test(arg),
validator: function (arg) arg in config.completers || /^custom,/.test(arg)
},
{
names: ["-description", "-desc", "-d"],

View File

@@ -1189,7 +1189,7 @@ var Completion = Module("completion", {
let builtin = Object.keys(Cc)
.filter(k => k.startsWith(services.AUTOCOMPLETE))
.map(key => {
let name = key.substr(services.AUTOCOMPLETE.length)
let name = key.substr(services.AUTOCOMPLETE.length);
return ["native:" + name, _("autocomplete.description", name)];
});

View File

@@ -62,8 +62,7 @@ var Group = Class("Group", {
get toStringParams() [this.name],
get builtin() this.modules.contexts.builtinGroups.indexOf(this) >= 0,
get builtin() this.modules.contexts.builtinGroups.indexOf(this) >= 0
}, {
compileFilter: function (patterns, default_=false) {
function siteFilter(uri) {

View File

@@ -329,7 +329,7 @@ var DOM = Class("DOM", {
let v = callable(val) ? val.call(thisObj || this, elem, i) : val;
highlight[(v == null ? highlight.has(hl) : !v) ? "remove" : "add"](hl);
}),
})
};
},
@@ -952,7 +952,7 @@ var DOM = Class("DOM", {
fix(DOM(this.document.defaultView));
});
},
}
}, {
/**
* Creates an actual event from a pseudo-event object.
@@ -1841,8 +1841,8 @@ var DOM = Class("DOM", {
iterateNext: function () result.iterateNext(),
get resultType() result.resultType,
get snapshotLength() result.snapshotLength,
snapshotItem: function (i) result.snapshotItem(i),
}
snapshotItem: function (i) result.snapshotItem(i)
};
if (asIterator)
res[Symbol.iterator] = function* () {
let elem;
@@ -1889,7 +1889,7 @@ var DOM = Class("DOM", {
},
namespaceNames: Class.Memoize(function ()
iter(this.namespaces).map(([k, v]) => ([v, k])).toObject()),
iter(this.namespaces).map(([k, v]) => ([v, k])).toObject())
});
Object.keys(DOM.Event.types).forEach(function (event) {

View File

@@ -146,7 +146,7 @@ var Download = Class("Download", {
},
_compare: {
active: (a, b) => a.active - b.active,
active: (a, b) => a.active - b.active,
complete: (a, b) => a.percentComplete - b.percentComplete,
date: (a, b) => a.startTime - b.startTime,
filename: (a, b) => String.localeCompare(a.targetFile.leafName, b.targetFile.leafName),
@@ -388,7 +388,7 @@ var DownloadList = Class("DownloadList",
onDownloadChanged: function onDownloadChanged(download) {
if (this.downloads.has(download)) {
download = this.downloads.get(download)
download = this.downloads.get(download);
download.updateStatus();
download.updateProgress();

View File

@@ -37,7 +37,7 @@ Highlight.liveProperty = function (name, prop) {
if (this.onChange)
this.onChange();
});
}
};
Highlight.liveProperty("agent");
Highlight.liveProperty("extends", "css");
Highlight.liveProperty("value", "css");

View File

@@ -976,7 +976,7 @@ unlet s:cpo_save
context.anchored = false;
context.keys = {
text: util.identity,
description: charset => io.charsetTitle(charset),
description: charset => io.charsetTitle(charset)
};
context.completions = io.charsets;
};
@@ -1034,7 +1034,7 @@ unlet s:cpo_save
isDirectory: function () s.substr(-1) == "/",
leafName: /([^\/]*)\/?$/.exec(s)[1]
}
for (s of io.listJar(uri.JARFile, getDir(uri.JAREntry)))]
for (s of io.listJar(uri.JARFile, getDir(uri.JAREntry)))];
};
else
context.generate = function generate_file() {

View File

@@ -641,8 +641,7 @@ var JavaScript = Module("javascript", {
.concat([k.substr(3) for (k of keys(Ci)) if (/^nsI/.test(k))])
.concat(this.magicalNames)
.filter(k => k in this.window));
}),
})
}, {
EVAL_TMP: "__dactyl_eval_tmp",

View File

@@ -186,7 +186,7 @@ var Modules = function Modules(window) {
modules.plugins = create(modules);
modules.modules = modules;
return modules;
}
};
config.loadStyles();

View File

@@ -442,7 +442,7 @@ var Option = Class("Option", {
SCOPE_BOTH: 3,
has: {
toggleAll: function toggleAll() toggleAll.supercall(this, "all") ^ !!toggleAll.superapply(this, arguments),
toggleAll: function toggleAll() toggleAll.supercall(this, "all") ^ !!toggleAll.superapply(this, arguments)
},
parseRegexp: function parseRegexp(value, result, flags) {
@@ -480,7 +480,7 @@ var Option = Class("Option", {
filter: filter,
result: result !== undefined ? result : !bang,
toString: function toString() this.bang + Option.quote(this.filter, /:/) +
(typeof this.result === "boolean" ? "" : ":" + quote(this.result)),
(typeof this.result === "boolean" ? "" : ":" + quote(this.result))
});
},
@@ -575,7 +575,7 @@ var Option = Class("Option", {
parseKey: {
number: Number,
boolean: function boolean(value) value == "true" || value == true ? true : false,
boolean: function boolean(value) value == "true" || value == true ? true : false
},
testValues: {

View File

@@ -342,7 +342,7 @@ var Overlay = Module("Overlay", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReferen
if (!event || !overlay.onWindowVisible || window != util.topWindow(window))
util.trapErrors("visible", obj, window);
else
overlay.onWindowVisible.push(function () { obj.visible(window) });
overlay.onWindowVisible.push(function () { obj.visible(window); });
}
if (obj.load)

View File

@@ -35,7 +35,7 @@ var Prefs = Module("prefs", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference])
__proto__: this,
get original() this.constructor(this.ORIGINAL + this.root),
get restore() this.constructor(this.RESTORE + this.root),
get saved() this.constructor(this.SAVED + this.root),
get saved() this.constructor(this.SAVED + this.root)
});
if (!defaults)
@@ -414,10 +414,10 @@ var Prefs = Module("prefs", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference])
yield option;
}
};
}
return template.options(_("pref.hostPreferences", config.host), prefs.call(this));
},
}
}, {
}, {
completion: function init_completion(dactyl, modules) {

View File

@@ -21,7 +21,7 @@ function withCallbacks(fn) {
function reject(arg) { deferred.reject(arg); }
fn.apply(this, [[resolve, reject, deferred]].concat(args));
return deferred.promise;
}
};
}
function CancelablePromise(executor, oncancel) {
@@ -111,7 +111,7 @@ var Promises = Module("Promises", {
task: function task(fn) {
return function task_(...args) {
return Task.spawn(fn.bind.apply(fn, [this].concat(args)));
}
};
},
/**
@@ -155,7 +155,7 @@ var Promises = Module("Promises", {
* @param {function} fn The function to wrap.
* @returns {Promise}
*/
withCallbacks: withCallbacks,
withCallbacks: withCallbacks
});
endModule();

View File

@@ -292,7 +292,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
"quit-application-granted": function (subject, data) {
if (this.runAtShutdown && !this.sanitizeItems(null, Range(), null, "shutdown"))
this.ranAtShutdown = true;
},
}
},
/**
@@ -582,7 +582,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
context.completions = Sanitizer.COMMANDS;
break;
}
},
}
});
},
completion: function initCompletion(dactyl, modules, window) {

View File

@@ -376,7 +376,7 @@ var Storage = Module("Storage", {
if (obj.privateData && obj.clone)
return obj.clone(this);
return obj;
},
}
}, {
Replacer: {
skipXpcom: function skipXpcom(key, val) val instanceof Ci.nsISupports ? null : val
@@ -803,7 +803,7 @@ var File = Class("File", {
return File.DoesNotExist(e);
}
return path;
},
}
});
{
@@ -891,7 +891,7 @@ var AsyncFile = Class("AsyncFile", File, {
*/
readDirectory: function readDirectory(callback) {
let iter = new OS.File.DirectoryIterator(dir);
let close = () => { iter.close() };
let close = () => { iter.close(); };
return iter.forEach(callback)
.then(close, close);
@@ -911,7 +911,7 @@ var AsyncFile = Class("AsyncFile", File, {
moveTo: function moveTo(path, options) {
return OS.File.move(this.path, path, options);
},
}
});
for (let m of ["makeDir",

View File

@@ -244,7 +244,7 @@ var Hive = Class("Hive", {
}
this.sheets = this.sheets.filter(s => matches.indexOf(s) == -1);
return matches.length;
},
}
});
/**
@@ -374,7 +374,7 @@ var Styles = Module("Styles", {
let type = services.stylesheet[agent ? "AGENT_SHEET" : "USER_SHEET"];
if (services.stylesheet.sheetRegistered(uri, type))
services.stylesheet.unregisterSheet(uri, type);
},
}
}, {
append: function (dest, src, sort) {
let props = {};
@@ -554,7 +554,7 @@ var Styles = Module("Styles", {
*/
quote: function quote(str) {
return '"' + str.replace(/([\\"])/g, "\\$1").replace(/\n/g, "\\00000a") + '"';
},
}
}, {
commands: function initCommands(dactyl, modules, window) {
const { commands, contexts, styles } = modules;
@@ -670,7 +670,7 @@ var Styles = Module("Styles", {
{
name: ["dels[tyle]"],
desc: "Remove a user style sheet",
action: function (sheet) sheet.remove(),
action: function (sheet) sheet.remove()
}
].forEach(function (cmd) {
commands.add(cmd.name, cmd.desc,

View File

@@ -459,7 +459,7 @@ var Template = Module("Template", {
let source = this.sourceLink(frame);
source[1]["dactyl:hint"] = source[2];
return source;
}
};
return ["table", {},
format.headings ?
["thead", { highlight: "UsageHead" },

View File

@@ -59,7 +59,7 @@ var wrapCallback = function wrapCallback(fn, isEvent) {
};
fn.wrapper.wrapped = fn;
return fn.wrapper;
}
};
var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]), {
Magic: Magic,

View File

@@ -52,12 +52,12 @@ function Controller(controller) {
this._countBeep = () => {
this.beepCount++;
}
};
this.errors = [];
this._countError = (message, highlight) => {
if (/\b(Error|Warning)Msg\b/.test(highlight))
this.errors.push(String(message));
}
};
this.modules.dactyl.registerObserver("beep", this._countBeep);
this.modules.dactyl.registerObserver("echoLine", this._countError);
this.modules.dactyl.registerObserver("echoMultiline", this._countError);