From af550c3839eafa7902ebd50dc7805e40dbadeee1 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sat, 19 Mar 2011 15:00:46 +1100 Subject: [PATCH] Run style bot. --HG-- extra : rebase_source : 3661ea16c48258e44239734cdad6bc18abc70b5f --- HACKING | 9 +--- common/bootstrap.js | 1 - common/content/bookmarks.js | 4 +- common/content/buffer.js | 16 +++---- common/content/commandline.js | 2 +- common/content/dactyl.js | 86 +++++++++++++++++------------------ common/content/editor.js | 8 ++-- common/content/hints.js | 2 +- common/content/statusline.js | 8 ++-- common/modules/commands.jsm | 2 +- common/modules/util.jsm | 2 +- 11 files changed, 67 insertions(+), 73 deletions(-) diff --git a/HACKING b/HACKING index 6b4ca69f..76536fd6 100644 --- a/HACKING +++ b/HACKING @@ -87,7 +87,7 @@ In general: Just look at the existing source code! https://developer.mozilla.org/en/New_in_JavaScript_1.7#Block_scope_with_let * Reuse common local variable names E.g. "elem" is generally used for element, - "win" for windows, "func" for functions, "ret" for return values etc. + "win" for windows, "func" for functions, "res" for return values etc. * Prefer // over /* */ comments (exceptions for big comments are usually OK) Right: if (HACK) // TODO: remove hack @@ -138,12 +138,7 @@ In general: Just look at the existing source code! Functional tests are implemented using the Mozmill automated testing framework -- https://developer.mozilla.org/en/Mozmill_Tests. -A fresh profile is created for the duration of the test run, however, passing -arguments to the host application won't be supported until Mozmill 1.5.2, the -next release, so any user RC and plugin files should be temporarily disabled. -This can be done by adding the following to the head of the RC file: -set loadplugins= -finish +A fresh profile is created for the duration of the test run. The host application binary tested can be overridden via the HOSTAPP_PATH makefile variable. E.g., diff --git a/common/bootstrap.js b/common/bootstrap.js index b17cba4c..8e88c3f4 100755 --- a/common/bootstrap.js +++ b/common/bootstrap.js @@ -41,7 +41,6 @@ if (!JSMLoader && "@mozilla.org/fuel/application;1" in Components.classes) .getService(Components.interfaces.extIApplication) .storage.get("dactyl.JSMLoader", null); - function reportError(e) { dump("\ndactyl: bootstrap: " + e + "\n" + (e.stack || Error().stack) + "\n"); Cu.reportError(e); diff --git a/common/content/bookmarks.js b/common/content/bookmarks.js index 4e7ded7f..a7e9bbad 100644 --- a/common/content/bookmarks.js +++ b/common/content/bookmarks.js @@ -403,7 +403,7 @@ var Bookmarks = Module("bookmarks", { completer: function title(context, args) { let frames = buffer.allFrames(); if (!args.bang) - return [ + return [ [win.document.title, frames.length == 1 ? "Current Location" : "Frame: " + win.location.href] for ([, win] in Iterator(frames))]; context.keys.text = "title"; @@ -521,7 +521,7 @@ var Bookmarks = Module("bookmarks", { let context = CompletionContext(args.join(" ")); context.fork("bookmark", 0, completion, "bookmark", args["-tags"], { keyword: args["-keyword"], title: args["-title"] }); - var deletedCount = bookmarks.remove(context.allItems.items.map(function (item) item.item.id)); + deletedCount = bookmarks.remove(context.allItems.items.map(function (item) item.item.id)); } dactyl.echomsg({ message: _("bookmark.deleted", deletedCount) }); diff --git a/common/content/buffer.js b/common/content/buffer.js index 6c18ef0a..7ea61625 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -742,7 +742,7 @@ var Buffer = Module("buffer", { * Shifts the focus to another frame within the buffer. Each buffer * contains at least one frame. * - * @param {number} count The number of frames to skip through. A negative + * @param {number} count The number of frames to skip through. A negative * count skips backwards. */ shiftFrameFocus: function shiftFrameFocus(count) { @@ -1006,14 +1006,14 @@ var Buffer = Module("buffer", { * Adjusts the page zoom of the current buffer relative to the * current zoom level. * - * @param {number} steps The integral number of natural fractions by - * which to adjust the current page zoom. If positive, the zoom - * level is increased, if negative it is decreased. + * @param {number} steps The integral number of natural fractions by which + * to adjust the current page zoom. If positive, the zoom level is + * increased, if negative it is decreased. * @param {boolean} fullZoom If true, zoom all content of the page, - * including raster images. If false, zoom only text. If omitted, - * use the current zoom function. @optional - * @throws {FailedAssertion} if the buffer's zoom level is already - * at its extreme in the given direction. + * including raster images. If false, zoom only text. If omitted, use + * the current zoom function. @optional + * @throws {FailedAssertion} if the buffer's zoom level is already at its + * extreme in the given direction. */ bumpZoomLevel: function bumpZoomLevel(steps, fullZoom) { if (fullZoom === undefined) diff --git a/common/content/commandline.js b/common/content/commandline.js index 5685c9da..c64df4c2 100644 --- a/common/content/commandline.js +++ b/common/content/commandline.js @@ -175,7 +175,7 @@ var CommandWidgets = Class("CommandWidgets", { if (obj.value != null) return [obj.value[0], obj.get ? obj.get.call(this, elem) : elem.value] - .concat(obj.value.slice(2)) + .concat(obj.value.slice(2)); return null; }, diff --git a/common/content/dactyl.js b/common/content/dactyl.js index 7a8ac25a..7f0a4930 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -732,7 +732,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { if (!list) res += list =