From d60c81ef23608e32bfa8c059a29a7deaf6b27473 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Fri, 19 Dec 2008 23:00:14 +1100 Subject: [PATCH] add missing semicolons --- common/content/commands.js | 8 ++++---- common/content/editor.js | 2 +- common/content/eval.js | 2 +- common/content/events.js | 4 ++-- common/content/find.js | 2 +- common/content/hints.js | 10 +++++----- common/content/io.js | 2 +- common/content/liberator-overlay.js | 2 +- common/content/liberator.js | 2 +- common/content/options.js | 6 +++--- common/content/style.js | 20 ++++++++++---------- common/content/tabs.js | 2 +- vimperator/content/bookmarks.js | 18 ++++++++++++------ vimperator/content/config.js | 2 +- 14 files changed, 44 insertions(+), 38 deletions(-) diff --git a/common/content/commands.js b/common/content/commands.js index 73beca92..75711744 100644 --- a/common/content/commands.js +++ b/common/content/commands.js @@ -120,7 +120,7 @@ Command.prototype = { if (matches && matches[2]) { commandline.inputMultiline(new RegExp("^" + matches[2] + "$", "m"), - function (args) { exec(matches[1] + "\n" + args) }); + function (args) { exec(matches[1] + "\n" + args); }); return; } } @@ -169,7 +169,7 @@ function Commands() //{{{ const quoteMap = { "\n": "n", "\t": "t" - } + }; function quote(q, list) { let re = RegExp("[" + list + "]", "g"); @@ -184,7 +184,7 @@ function Commands() //{{{ '"': quote('"', '\n\t"\\\\'), "'": quote("'", "\\\\'"), "": quote("", "\\\\ ") - } + }; const ArgType = new Struct("description", "parse"); const argTypes = [ @@ -555,7 +555,7 @@ function Commands() //{{{ if (complete) { if (argCount == "0" || args.length > 0 && (/[1?]/.test(argCount))) - complete.highlight(i, sub.length, "SPELLCHECK") + complete.highlight(i, sub.length, "SPELLCHECK"); } if (args.length == literal) diff --git a/common/content/editor.js b/common/content/editor.js index be1b3aba..6219a4ea 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -857,7 +857,7 @@ function Editor() //{{{ editor.selection.deleteFromDocument(); editor.insertText(val); } - }, this) + }, this); if (res == false) throw "Couldn't create temporary file"; } diff --git a/common/content/eval.js b/common/content/eval.js index 14f5fd95..daf0dba6 100644 --- a/common/content/eval.js +++ b/common/content/eval.js @@ -1,4 +1,4 @@ -try { __liberator_eval_result = eval(__liberator_eval_string) +try { __liberator_eval_result = eval(__liberator_eval_string); } catch (e) { diff --git a/common/content/events.js b/common/content/events.js index 0007de2f..4c1d9f8c 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -689,7 +689,7 @@ function Events() //{{{ commands.add(["macros"], "List all macros", - function (args) { completion.listCompleter("macro", args[0]) }, + function (args) { completion.listCompleter("macro", args[0]); }, { argCount: "?", completer: function (context) completion.macro(context) @@ -1283,7 +1283,7 @@ function Events() //{{{ { events.feedingKeys = false; if (lastMacro) - setTimeout(function () { liberator.echomsg("Canceled playback of macro '" + lastMacro + "'") }, 100); + setTimeout(function () { liberator.echomsg("Canceled playback of macro '" + lastMacro + "'"); }, 100); event.preventDefault(); event.stopPropagation(); return true; diff --git a/common/content/find.js b/common/content/find.js index 794476ac..41b15599 100644 --- a/common/content/find.js +++ b/common/content/find.js @@ -176,7 +176,7 @@ function Search() //{{{ return; } - var baseNode = + var baseNode = ; baseNode = util.xmlToDom(baseNode, window.content.document); var body = doc.body; diff --git a/common/content/hints.js b/common/content/hints.js index 25803f34..90c7e14f 100644 --- a/common/content/hints.js +++ b/common/content/hints.js @@ -237,7 +237,7 @@ function Hints() //{{{ hint[IMGSPAN] = imgspan; span.parentNode.appendChild(imgspan); } - setClass(imgspan, activeHint == hintnum) + setClass(imgspan, activeHint == hintnum); } span.setAttribute("number", hintnum); @@ -289,7 +289,7 @@ function Hints() //{{{ // animate the disappearance of the first hint if (timeout && firstElem) - setTimeout(function () { firstElem.removeAttributeNS(NS.uri, "highlight") }, timeout); + setTimeout(function () { firstElem.removeAttributeNS(NS.uri, "highlight"); }, timeout); } styles.removeSheet("hint-positions", null, null, null, true); @@ -374,7 +374,7 @@ function Hints() //{{{ { linkText = linkText.toLowerCase(); return tokens.every(function (token) linkText.indexOf(token) >= 0); - } + }; } //}}} function wordStartsWithMatcher(hintString, allowWordOverleaping) //{{{ @@ -502,7 +502,7 @@ function Hints() //{{{ return charsAtBeginningOfWords(hintStrings[0], words, allowWordOverleaping); else return stringsAtBeginningOfWords(hintStrings, words, allowWordOverleaping); - } + }; } //}}} let hintMatching = options["hintmatching"]; @@ -584,7 +584,7 @@ function Hints() //{{{ function (count) { extendedhintCount = count; - commandline.input(";", function (arg) { setTimeout(function () hints.show(arg), 0) }, + commandline.input(";", function (arg) { setTimeout(function () hints.show(arg), 0); }, { promptHighlight: "Normal", completer: function (context) diff --git a/common/content/io.js b/common/content/io.js index fd111d52..8a5e3d97 100644 --- a/common/content/io.js +++ b/common/content/io.js @@ -30,7 +30,7 @@ the terms of any one of the MPL, the GPL or the LGPL. plugins.contexts = {}; function Script(file) { - let self = plugins.contexts[file.path] + let self = plugins.contexts[file.path]; if (self) { if (self.onUnload) diff --git a/common/content/liberator-overlay.js b/common/content/liberator-overlay.js index 288559e2..9b0df22b 100644 --- a/common/content/liberator-overlay.js +++ b/common/content/liberator-overlay.js @@ -13,7 +13,7 @@ { try { - loader.loadSubScript(base + script, modules) + loader.loadSubScript(base + script, modules); return; } catch (e) diff --git a/common/content/liberator.js b/common/content/liberator.js index 8c49505c..373a22d1 100644 --- a/common/content/liberator.js +++ b/common/content/liberator.js @@ -109,7 +109,7 @@ const liberator = (function () //{{{ .forEach(function (elem) { if (elem) - elem.collapsed = (opts.indexOf(opt) == -1) + elem.collapsed = (opts.indexOf(opt) == -1); }); } } diff --git a/common/content/options.js b/common/content/options.js index 460490bb..6373dcb6 100644 --- a/common/content/options.js +++ b/common/content/options.js @@ -73,7 +73,7 @@ function Option(names, description, type, defaultValue, extraInfo) //{{{ } Option.prototype = { get globalvalue() options.store.get(this.name), - set globalvalue(val) { options.store.set(this.name, val) }, + set globalvalue(val) { options.store.set(this.name, val); }, parseValues: function (value) { @@ -164,8 +164,8 @@ Option.prototype = { if (this.checkHas) test = function (val) values.some(function (value) self.checkHas(value, val)); let values = this.values; - /* Return whether some argument matches */ - return Array.some(arguments, function (val) test(val)) + // return whether some argument matches + return Array.some(arguments, function (val) test(val)); }, hasName: function (name) this.names.indexOf(name) >= 0, diff --git a/common/content/style.js b/common/content/style.js index ca9f0f1c..62c14ef2 100644 --- a/common/content/style.js +++ b/common/content/style.js @@ -166,7 +166,7 @@ function Highlights(name, store, serial) return error; style.value = newStyle; highlight[style.class] = style; - } + }; this.selector = function (class) { @@ -200,7 +200,7 @@ function Highlights(name, store, serial) if (hl.value == hl.default) this.set(class); } - } + }; } function Styles(name, store, serial) @@ -264,7 +264,7 @@ function Styles(name, store, serial) names[name] = sheet; } return null; - } + }; this.findSheets = function (name, filter, css, index, system) { @@ -324,7 +324,7 @@ function Styles(name, store, serial) } } return matches.length; - } + }; this.registerSheet = function (uri, doCheckSyntax, reload) { @@ -336,14 +336,14 @@ function Styles(name, store, serial) uri = ios.newURI(uri, null, null); if (reload || !sss.sheetRegistered(uri, sss.USER_SHEET)) sss.loadAndRegisterSheet(uri, sss.USER_SHEET); - } + }; this.unregisterSheet = function (uri) { uri = ios.newURI(uri, null, null); if (sss.sheetRegistered(uri, sss.USER_SHEET)) sss.unregisterSheet(uri, sss.USER_SHEET); - } + }; // FIXME this.registerAgentSheet = function (uri) @@ -351,14 +351,14 @@ function Styles(name, store, serial) this.unregisterAgentSheet(uri); uri = ios.newURI(uri, null, null); sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET); - } + }; this.unregisterAgentSheet = function (uri) { uri = ios.newURI(uri, null, null); if (sss.sheetRegistered(uri, sss.AGENT_SHEET)) sss.unregisterSheet(uri, sss.AGENT_SHEET); - } + }; function wrapCSS(sheet) { @@ -425,7 +425,7 @@ function Styles(name, store, serial) if (errors.length) { let err = new Error("", errors[0].sourceName.replace(/^(chrome-data:text\/css,).*/, "$1..."), errors[0].lineNumber); - err.name = "CSSError" + err.name = "CSSError"; err.message = errors.reduce(function (msg, e) msg + "; " + e.lineNumber + ": " + e.errorMessage, errors.shift().errorMessage); err.echoerr = err.fileName + ":" + err.lineNumber + ": " + err.message; @@ -516,7 +516,7 @@ liberator.registerObserver("load_commands", function () } catch (e) {} context.anchored = false; - context.completions = compl.concat([[s, ""] for each (s in styles.sites)]) + context.completions = compl.concat([[s, ""] for each (s in styles.sites)]); } else if (args.completeArg == 1) { diff --git a/common/content/tabs.js b/common/content/tabs.js index 6fee2043..6cec525d 100644 --- a/common/content/tabs.js +++ b/common/content/tabs.js @@ -598,7 +598,7 @@ function Tabs() //{{{ function (args) { let count = args.count; - args = args[0] + args = args[0]; if (count < 1) count = 1; diff --git a/vimperator/content/bookmarks.js b/vimperator/content/bookmarks.js index 9dd6e9b1..8acac9f7 100644 --- a/vimperator/content/bookmarks.js +++ b/vimperator/content/bookmarks.js @@ -238,7 +238,7 @@ function Bookmarks() //{{{ var cache = storage.newObject("bookmark-cache", Cache, false); storage.addObserver("bookmark-cache", bookmarkObserver); liberator.registerObserver("shutdown", function () { - storage.removeObserver("bookmark-cache", bookmarkObserver) + storage.removeObserver("bookmark-cache", bookmarkObserver); }); liberator.registerObserver("enter", function () { @@ -358,7 +358,7 @@ function Bookmarks() //{{{ if (!args.bang) { context.completions = [[content.document.documentURI, "Current Location"]]; - return + return; } completion.bookmark(context, args["-tags"], { keyword: args["-keyword"], title: args["-title"] }); }, @@ -784,7 +784,7 @@ function History() //{{{ function (args) { history.list(args.join(" "), args.bang, args["-max"] || 1000); }, { bang: true, - completer: function (context) { context.quote = null, completion.history(context) }, + completer: function (context) { context.quote = null, completion.history(context); }, options: [[["-max", "-m"], options.OPTION_INT]] // completer: function (filter) completion.history(filter) }); @@ -823,7 +823,7 @@ function History() //{{{ url: node.uri, title: node.title, icon: node.icon ? node.icon.spec : DEFAULT_FAVICON - } + }; }); root.containerOpen = false; // close a container after using it! @@ -844,7 +844,10 @@ function History() //{{{ { let index = window.getWebNavigation().sessionHistory.index; if (index == 0) - return liberator.beep(); // really wanted? + { + liberator.beep(); // XXX: really wanted? + return; + } window.getWebNavigation().gotoIndex(0); }, @@ -853,7 +856,10 @@ function History() //{{{ { let index = window.getWebNavigation().sessionHistory.index; if (index == window.getWebNavigation().sessionHistory.count - 1) - return liberator.beep(); + { + liberator.beep(); + return; + } window.getWebNavigation().gotoIndex(max); }, diff --git a/vimperator/content/config.js b/vimperator/content/config.js index a11c8e2c..cc353a28 100644 --- a/vimperator/content/config.js +++ b/vimperator/content/config.js @@ -171,7 +171,7 @@ const config = { //{{{ + "}", true); delete img; - } + }; //////////////////////////////////////////////////////////////////////////////// ////////////////////// MAPPINGS ////////////////////////////////////////////////