Skip to content

Commit

Permalink
Remove unecessery semicolons (#515)
Browse files Browse the repository at this point in the history
  • Loading branch information
gkatsev committed Jun 8, 2016
1 parent a2e4a4f commit 13056b5
Show file tree
Hide file tree
Showing 16 changed files with 36 additions and 36 deletions.
6 changes: 3 additions & 3 deletions common/components/protocols.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const systemPrincipal = channel.owner;
channel.cancel(NS_BINDING_ABORTED);
delete channel;

function dataURL(type, data) "data:" + (type || "application/xml;encoding=UTF-8") + "," + encodeURIComponent(data);
function dataURL(type, data) "data:" + (type || "application/xml;encoding=UTF-8") + "," + encodeURIComponent(data)
function makeChannel(url, orig) {
if (typeof url == "function")
url = dataURL.apply(null, url());
Expand All @@ -40,7 +40,7 @@ function makeChannel(url, orig) {
channel.originalURI = orig;
return channel;
}
function fakeChannel(orig) makeChannel("chrome://liberator/content/does/not/exist", orig);
function fakeChannel(orig) makeChannel("chrome://liberator/content/does/not/exist", orig)
function redirect(to, orig) {
//xxx: escape
let html = '<html><head><meta http-equiv="Refresh" content="' + ("0;" + to).replace(/"/g, "&quot;") + '"/></head></html>';
Expand Down Expand Up @@ -161,6 +161,6 @@ var components = [ChromeData, Liberator];
if(XPCOMUtils.generateNSGetFactory)
var NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
else
function NSGetModule(compMgr, fileSpec) XPCOMUtils.generateModule(components);
function NSGetModule(compMgr, fileSpec) XPCOMUtils.generateModule(components)

// vim: set fdm=marker sw=4 ts=4 et:
4 changes: 2 additions & 2 deletions common/content/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ function curry(fn, length, self, acc) {
return fn;

// Close over function with 'this'
function close(self, fn) function () fn.apply(self, Array.slice(arguments));
function close(self, fn) function () fn.apply(self, Array.slice(arguments))

if (acc == null)
acc = [];
Expand Down Expand Up @@ -366,7 +366,7 @@ Class.prototype = {
*/
setTimeout: function (callback, timeout) {
const self = this;
function target() callback.call(self);
function target() callback.call(self)
return window.setTimeout(target, timeout);
}
};
Expand Down
6 changes: 3 additions & 3 deletions common/content/commandline.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ const CommandLine = Module("commandline", {
liberator.triggerObserver("echoLine", str, highlightGroup, forceSingle);

//if (!this._commandShown())
;//commandline.hide();
//commandline.hide();

/*let field = this._messageBox.inputField;
if (!forceSingle && field.editor.rootElement.scrollWidth > field.scrollWidth)
Expand Down Expand Up @@ -1370,7 +1370,7 @@ const CommandLine = Module("commandline", {
try {
this.waiting = true;
for (let context of list) {
function done() !(idx >= n + context.items.length || idx == -2 && !context.items.length);
function done() !(idx >= n + context.items.length || idx == -2 && !context.items.length)
while (context.incomplete && !done())
liberator.threadYield(false, true);

Expand Down Expand Up @@ -1799,7 +1799,7 @@ const ItemList = Class("ItemList", {
let off = 0;
let end = this._startIndex + options.maxitems;
function getRows(context) {
function fix(n) util.Math.constrain(n, 0, len);
function fix(n) util.Math.constrain(n, 0, len)
let len = context.items.length;
let start = off;
end -= !!context.message + context.incomplete;
Expand Down
6 changes: 3 additions & 3 deletions common/content/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ const Commands = Module("commands", {
*/
commandToString: function (args) {
let res = [args.command + (args.bang ? "!" : "")];
function quote(str) Commands.quoteArg[/[\s"'\\]|^$/.test(str) ? '"' : ""](str);
function quote(str) Commands.quoteArg[/[\s"'\\]|^$/.test(str) ? '"' : ""](str)

for (let [opt, val] in Iterator(args.options || {})) {
let chr = /^-.$/.test(opt) ? " " : "=";
Expand Down Expand Up @@ -1214,9 +1214,9 @@ const Commands = Module("commands", {
function quote(q, list) {
let re = RegExp("[" + list + "]", "g");
return function (str) q + String.replace(str, re, function ($0) $0 in Commands.quoteMap ? Commands.quoteMap[$0] : ("\\" + $0)) + q;
};
}
function vimSingleQuote(s)
s.replace(/'/g, "''");
s.replace(/'/g, "''")
Commands.complQuote = { // FIXME
'"': ['"', quote("", '\n\t"\\\\'), '"'],
"'": ["'", vimSingleQuote, "'"],
Expand Down
8 changes: 4 additions & 4 deletions common/content/hints.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ const Hints = Module("hints", {

const Mode = Hints.Mode;
Mode.defaultValue("tags", function () function () options.hinttags);
function extended() options.extendedhinttags;
function images() "//*[@src]";
function anchors() "//*[@id or @name]";
function extended() options.extendedhinttags
function images() "//*[@src]"
function anchors() "//*[@id or @name]"

this._hintModes = {
";": Mode("Focus hint", function (elem) buffer.focusElement(elem), extended),
Expand Down Expand Up @@ -698,7 +698,7 @@ const Hints = Module("hints", {
* @param {string} str The string to split.
* @returns {Array(string)} The lowercased splits of the splitting.
*/
function tokenize(pat, str) str.split(pat).map(String.toLowerCase);
function tokenize(pat, str) str.split(pat).map(String.toLowerCase)

/**
* Get a hint matcher for hintmatching=contains
Expand Down
4 changes: 2 additions & 2 deletions common/content/io.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ const File = Class("File", {
!liberator.has("Windows") ? /\$(\w+)\b|\${(\w+)}/g
: /\$(\w+)\b|\${(\w+)}|%(\w+)%/g,
function (m, n1, n2, n3) services.get("environment").get(n1 || n2 || n3) || m
);
)
path = expand(path);

// expand ~
Expand Down Expand Up @@ -770,7 +770,7 @@ lookup:
system: function (command, input) {
liberator.echomsg("Executing: " + command);

function escape(str) '"' + str.replace(/[\\"$]/g, "\\$&") + '"';
function escape(str) '"' + str.replace(/[\\"$]/g, "\\$&") + '"'

return this.withTempFiles(function (stdin, stdout, cmd) {
if (input)
Expand Down
2 changes: 1 addition & 1 deletion common/content/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ const JavaScript = Module("javascript", {
// Constants are unsorted, and appear before other non-null strings.
// Other strings are sorted in the default manner.
let compare = context.compare;
function isnan(item) item != '' && isNaN(item);
function isnan(item) item != '' && isNaN(item)
context.compare = function (a, b) {
if (!isnan(a.item.key) && !isnan(b.item.key))
return a.item.key - b.item.key;
Expand Down
4 changes: 2 additions & 2 deletions common/content/liberator.js
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ const Liberator = Module("liberator", {
let items = completion._runCompleter("help", topic, null, unchunked).items;
let partialMatch = null;

function format(item) item.description + "#" + encodeURIComponent(item.text);
function format(item) item.description + "#" + encodeURIComponent(item.text)

for (let item of items) {
if (item.text == topic)
Expand Down Expand Up @@ -1470,7 +1470,7 @@ const Liberator = Module("liberator", {
e.original.uninstall();
else
e.original.userDisabled = command.action == "disableItem";
};
}

if (args.bang)
liberator.extensions.forEach(function (e) { action(e); });
Expand Down
2 changes: 1 addition & 1 deletion common/content/mappings.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const Map = Class("Map", {
args.push(argument);

let self = this;
function repeat() self.action.apply(self, args);
function repeat() self.action.apply(self, args)
if (this.names[0] != ".") // FIXME: Kludge.
mappings.repeat = repeat;

Expand Down
4 changes: 2 additions & 2 deletions common/content/modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Module.constructors = {};
window.addEventListener("load", function onload() {
window.removeEventListener("load", onload, false);

function dump(str) window.dump(String.replace(str, /\n?$/, "\n").replace(/^/m, Config.prototype.name.toLowerCase() + ": "));
function dump(str) window.dump(String.replace(str, /\n?$/, "\n").replace(/^/m, Config.prototype.name.toLowerCase() + ": "))
const start = Date.now();
const deferredInit = { load: [] };
const seen = new Set();
Expand All @@ -91,7 +91,7 @@ window.addEventListener("load", function onload() {
loaded.push(module.name);

function init(mod, module)
function () module.INIT[mod].call(modules[module.name], modules[mod]);
function () module.INIT[mod].call(modules[module.name], modules[mod])
for (let mod of loaded) {
try {
if (mod in module.INIT)
Expand Down
4 changes: 2 additions & 2 deletions common/content/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ const Options = Module("options", {
option.value = xml`=${template.highlight(opt.value)}`;
yield option;
}
};
}

let list = template.options("Options", opts());
commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE);
Expand Down Expand Up @@ -658,7 +658,7 @@ const Options = Module("options", {

yield option;
}
};
}

let list = template.options(config.hostApplication + " Options", prefs());
commandline.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE);
Expand Down
2 changes: 1 addition & 1 deletion muttator/components/about-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ AboutHandler.prototype = {
if(XPCOMUtils.generateNSGetFactory)
var NSGetFactory = XPCOMUtils.generateNSGetFactory([AboutHandler]);
else
function NSGetModule(compMgr, fileSpec) XPCOMUtils.generateModule([AboutHandler]);
function NSGetModule(compMgr, fileSpec) XPCOMUtils.generateModule([AboutHandler])

// vim: set fdm=marker sw=4 ts=4 et:
2 changes: 1 addition & 1 deletion muttator/components/commandline-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ CommandLineHandler.prototype = {
if(XPCOMUtils.generateNSGetFactory)
var NSGetFactory = XPCOMUtils.generateNSGetFactory([CommandLineHandler]);
else
function NSGetModule(compMgr, fileSpec) XPCOMUtils.generateModule([CommandLineHandler]);
function NSGetModule(compMgr, fileSpec) XPCOMUtils.generateModule([CommandLineHandler])

// vim: set ft=javascript fdm=marker sw=4 ts=4 et:
2 changes: 1 addition & 1 deletion vimperator/components/about-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ AboutHandler.prototype = {
if(XPCOMUtils.generateNSGetFactory)
var NSGetFactory = XPCOMUtils.generateNSGetFactory([AboutHandler]);
else
function NSGetModule(compMgr, fileSpec) XPCOMUtils.generateModule([AboutHandler]);
function NSGetModule(compMgr, fileSpec) XPCOMUtils.generateModule([AboutHandler])

// vim: set fdm=marker sw=4 ts=4 et:
2 changes: 1 addition & 1 deletion vimperator/components/commandline-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ CommandLineHandler.prototype = {
if(XPCOMUtils.generateNSGetFactory)
var NSGetFactory = XPCOMUtils.generateNSGetFactory([CommandLineHandler]);
else
function NSGetModule(compMgr, fileSpec) XPCOMUtils.generateModule([CommandLineHandler]);
function NSGetModule(compMgr, fileSpec) XPCOMUtils.generateModule([CommandLineHandler])

// vim: set ft=javascript fdm=marker sw=4 ts=4 et:
14 changes: 7 additions & 7 deletions vimperator/regressions.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,20 @@ function resetEnvironment() {
modes.reset();
}

function getOutput() multilineOutput.contentDocument.body.textContent || singlelineOutput.value;
function getMultilineOutput() multilineOutput.contentDocument.body.textContent;
function getSinglelineOutput() singlelineOutput.value;
function getOutput() multilineOutput.contentDocument.body.textContent || singlelineOutput.value
function getMultilineOutput() multilineOutput.contentDocument.body.textContent
function getSinglelineOutput() singlelineOutput.value

function getTabIndex() getBrowser().mTabContainer.selectedIndex;
function getTabCount() getBrowser().mTabs.length;
function getTabIndex() getBrowser().mTabContainer.selectedIndex
function getTabCount() getBrowser().mTabs.length

function getBufferPosition() {
let win = window.content;
return { x: win.scrollMaxX ? win.pageXOffset / win.scrollMaxX : 0,
y: win.scrollMaxY ? win.pageYOffset / win.scrollMaxY : 0 }
};
}

function getLocation() window.content.document.location.href;
function getLocation() window.content.document.location.href

function echoLine(str, group) {
if (!doc)
Expand Down

0 comments on commit 13056b5

Please sign in to comment.