summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKris Maglione <kris@vimperator.org>2010-08-15 07:49:52 -0400
committerKris Maglione <kris@vimperator.org>2010-08-15 07:49:52 -0400
commitdaa2d5dcc53d648db012f01cd879c29f280d52fa (patch)
treeaf1d8821137dda7cba50e2a34721f880cdf33128
parentf3c32988f12b725988ce86ff55d98d0b1ac3ccb6 (diff)
downloadpentadactyl-daa2d5dcc53d648db012f01cd879c29f280d52fa.tar.gz
Use JS5's strict mode. But, alas! it outlaws octal! Oh the inanity...
--HG-- branch : testing
-rw-r--r--common/components/protocols.js2
-rw-r--r--common/content/autocommands.js2
-rw-r--r--common/content/base.js1
-rw-r--r--common/content/bookmarks.js2
-rw-r--r--common/content/browser.js2
-rw-r--r--common/content/buffer.js2
-rw-r--r--common/content/commandline.js3
-rw-r--r--common/content/commands.js2
-rw-r--r--common/content/completion.js6
-rw-r--r--common/content/configbase.js1
-rw-r--r--common/content/editor.js2
-rw-r--r--common/content/events.js2
-rw-r--r--common/content/finder.js1
-rw-r--r--common/content/help.js2
-rw-r--r--common/content/hints.js2
-rw-r--r--common/content/history.js1
-rw-r--r--common/content/io.js6
-rw-r--r--common/content/javascript.js3
-rw-r--r--common/content/liberator-overlay.js1
-rw-r--r--common/content/liberator.js2
-rw-r--r--common/content/mappings.js2
-rw-r--r--common/content/marks.js1
-rw-r--r--common/content/modes.js1
-rw-r--r--common/content/modules.js1
-rw-r--r--common/content/options.js1
-rw-r--r--common/content/quickmarks.js1
-rw-r--r--common/content/sanitizer.js1
-rw-r--r--common/content/services.js1
-rw-r--r--common/content/statusline.js1
-rw-r--r--common/content/style.js1
-rw-r--r--common/content/tabs.js2
-rw-r--r--common/content/template.js2
-rw-r--r--common/content/util.js4
-rw-r--r--common/modules/storage.jsm1
-rw-r--r--vimperator/components/about-handler.js1
-rw-r--r--vimperator/components/commandline-handler.js1
36 files changed, 44 insertions, 23 deletions
diff --git a/common/components/protocols.js b/common/components/protocols.js
index 2dd50338..29cff951 100644
--- a/common/components/protocols.js
+++ b/common/components/protocols.js
@@ -2,7 +2,7 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
-
+"use strict";
/* Adds support for data: URIs with chrome privileges
* and fragment identifiers.
diff --git a/common/content/autocommands.js b/common/content/autocommands.js
index 1417e684..36750b75 100644
--- a/common/content/autocommands.js
+++ b/common/content/autocommands.js
@@ -4,7 +4,7 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
-
+"use strict";
/** @scope modules */
diff --git a/common/content/base.js b/common/content/base.js
index 16a6422d..4eab72e7 100644
--- a/common/content/base.js
+++ b/common/content/base.js
@@ -2,6 +2,7 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
+"use strict";
const Cc = Components.classes;
const Ci = Components.interfaces;
diff --git a/common/content/bookmarks.js b/common/content/bookmarks.js
index 7c7d47f0..eea59c69 100644
--- a/common/content/bookmarks.js
+++ b/common/content/bookmarks.js
@@ -4,7 +4,7 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
-
+"use strict";
const DEFAULT_FAVICON = "chrome://mozapps/skin/places/defaultFavicon.png";
diff --git a/common/content/browser.js b/common/content/browser.js
index 2f47a583..1ceb716c 100644
--- a/common/content/browser.js
+++ b/common/content/browser.js
@@ -4,7 +4,7 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
-
+"use strict";
/** @scope modules */
diff --git a/common/content/buffer.js b/common/content/buffer.js
index b73e718f..7bceb5f1 100644
--- a/common/content/buffer.js
+++ b/common/content/buffer.js
@@ -4,7 +4,7 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
-
+"use strict";
/** @scope modules */
diff --git a/common/content/commandline.js b/common/content/commandline.js
index 78db2968..f0e057c9 100644
--- a/common/content/commandline.js
+++ b/common/content/commandline.js
@@ -4,6 +4,7 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
+"use strict";
/** @scope modules */
@@ -971,7 +972,7 @@ const CommandLine = Module("commandline", {
let doc = this._multilineOutputWidget.contentDocument;
- availableHeight = config.outputHeight;
+ let availableHeight = config.outputHeight;
if (!this._outputContainer.collapsed)
availableHeight += parseFloat(this._outputContainer.height);
doc.body.style.minWidth = this._commandlineWidget.scrollWidth + "px";
diff --git a/common/content/commands.js b/common/content/commands.js
index 8b59730a..c774bc28 100644
--- a/common/content/commands.js
+++ b/common/content/commands.js
@@ -4,7 +4,7 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
-
+"use strict";
/** @scope modules */
diff --git a/common/content/completion.js b/common/content/completion.js
index c5beb117..bccd4052 100644
--- a/common/content/completion.js
+++ b/common/content/completion.js
@@ -4,7 +4,7 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
-
+"use strict";
/** @scope modules */
@@ -412,12 +412,12 @@ const CompletionContext = Class("CompletionContext", {
let filter = fixCase(this.filter);
if (this.anchored) {
var compare = function compare(text, s) text.substr(0, s.length) == s;
- substrings = util.map(util.range(filter.length, text.length + 1),
+ var substrings = util.map(util.range(filter.length, text.length + 1),
function (end) text.substring(0, end));
}
else {
var compare = function compare(text, s) text.indexOf(s) >= 0;
- substrings = [];
+ var substrings = [];
let start = 0;
let idx;
let length = filter.length;
diff --git a/common/content/configbase.js b/common/content/configbase.js
index 215695ef..478a1417 100644
--- a/common/content/configbase.js
+++ b/common/content/configbase.js
@@ -4,6 +4,7 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
+"use strict";
const ConfigBase = Class(ModuleBase, {
/**
diff --git a/common/content/editor.js b/common/content/editor.js
index 70414226..0307c98a 100644
--- a/common/content/editor.js
+++ b/common/content/editor.js
@@ -2,7 +2,7 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
-
+"use strict";
/** @scope modules */
diff --git a/common/content/events.js b/common/content/events.js
index e96a67bc..dbfe3c90 100644
--- a/common/content/events.js
+++ b/common/content/events.js
@@ -4,7 +4,7 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
-
+"use strict";
/** @scope modules */
diff --git a/common/content/finder.js b/common/content/finder.js
index 3322f12c..71283c2c 100644
--- a/common/content/finder.js
+++ b/common/content/finder.js
@@ -2,6 +2,7 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
+"use strict";
/** @scope modules */
diff --git a/common/content/help.js b/common/content/help.js
index 67fbba37..ed1dd22a 100644
--- a/common/content/help.js
+++ b/common/content/help.js
@@ -2,7 +2,7 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
-
+"use strict";
function checkFragment() {
document.title = document.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "title")[0].textContent;
diff --git a/common/content/hints.js b/common/content/hints.js
index ca0037f4..977765a9 100644
--- a/common/content/hints.js
+++ b/common/content/hints.js
@@ -4,7 +4,7 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
-
+"use strict";
/** @scope modules */
/** @instance hints */
diff --git a/common/content/history.js b/common/content/history.js
index 281d797d..dbab5522 100644
--- a/common/content/history.js
+++ b/common/content/history.js
@@ -4,6 +4,7 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
+"use strict";
const History = Module("history", {
requires: ["config"],
diff --git a/common/content/io.js b/common/content/io.js
index 8d5faf64..4ca6174f 100644
--- a/common/content/io.js
+++ b/common/content/io.js
@@ -5,7 +5,7 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
-
+"use strict";
/** @scope modules */
@@ -162,7 +162,7 @@ const File = Class("File", {
mode = File.MODE_WRONLY | File.MODE_CREATE | File.MODE_TRUNCATE;
if (!perms)
- perms = 0644;
+ perms = parseInt('0644', 8);
ofstream.init(this, mode, perms, 0);
let ocstream = getStream(0);
@@ -487,7 +487,7 @@ const IO = Module("io", {
let file = services.get("directory").get("TmpD", Ci.nsIFile);
file.append(config.tempFile);
- file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0600);
+ file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, parseInt('0600', 8));
return File(file);
},
diff --git a/common/content/javascript.js b/common/content/javascript.js
index e2c6a50d..4880e6d0 100644
--- a/common/content/javascript.js
+++ b/common/content/javascript.js
@@ -2,6 +2,7 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
+"use strict";
// TODO: Clean this up.
@@ -109,7 +110,7 @@ const JavaScript = Module("javascript", {
return completions;
},
- eval: function eval(arg, key, tmp) {
+ eval: function evalstr(arg, key, tmp) {
let cache = this.context.cache.eval;
let context = this.context.cache.evalContext;
diff --git a/common/content/liberator-overlay.js b/common/content/liberator-overlay.js
index ae32b8a2..e9461df4 100644
--- a/common/content/liberator-overlay.js
+++ b/common/content/liberator-overlay.js
@@ -2,6 +2,7 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
+"use strict";
(function () {
const modules = {};
diff --git a/common/content/liberator.js b/common/content/liberator.js
index 86d6e108..02878811 100644
--- a/common/content/liberator.js
+++ b/common/content/liberator.js
@@ -4,7 +4,7 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
-
+"use strict";
/** @scope modules */
diff --git a/common/content/mappings.js b/common/content/mappings.js
index 7d1fa3fa..5e02bba5 100644
--- a/common/content/mappings.js
+++ b/common/content/mappings.js
@@ -4,7 +4,7 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
-
+"use strict";
/** @scope modules */
diff --git a/common/content/marks.js b/common/content/marks.js
index 44aadbc8..d6c7b908 100644
--- a/common/content/marks.js
+++ b/common/content/marks.js
@@ -4,6 +4,7 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
+"use strict";
/**
* @scope modules
diff --git a/common/content/modes.js b/common/content/modes.js
index 5a4948fc..16d660b5 100644
--- a/common/content/modes.js
+++ b/common/content/modes.js
@@ -4,6 +4,7 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
+"use strict";
/** @scope modules */
diff --git a/common/content/modules.js b/common/content/modules.js
index e3c8b5eb..bc934815 100644
--- a/common/content/modules.js
+++ b/common/content/modules.js
@@ -2,6 +2,7 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
+"use strict";
/**
* @class ModuleBase
diff --git a/common/content/options.js b/common/content/options.js
index f34a721e..59070bb6 100644
--- a/common/content/options.js
+++ b/common/content/options.js
@@ -4,6 +4,7 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
+"use strict";
/** @scope modules */
diff --git a/common/content/quickmarks.js b/common/content/quickmarks.js
index 20cb8b33..3c02dfd5 100644
--- a/common/content/quickmarks.js
+++ b/common/content/quickmarks.js
@@ -4,6 +4,7 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
+"use strict";
/** @scope modules */
diff --git a/common/content/sanitizer.js b/common/content/sanitizer.js
index 146f6fa4..85b8c4ea 100644
--- a/common/content/sanitizer.js
+++ b/common/content/sanitizer.js
@@ -2,6 +2,7 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
+"use strict";
// TODO:
// - fix Sanitize autocommand
diff --git a/common/content/services.js b/common/content/services.js
index 29a76e80..3311bf4c 100644
--- a/common/content/services.js
+++ b/common/content/services.js
@@ -2,6 +2,7 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
+"use strict";
/** @scope modules */
diff --git a/common/content/statusline.js b/common/content/statusline.js
index 57baac40..7b619beb 100644
--- a/common/content/statusline.js
+++ b/common/content/statusline.js
@@ -4,6 +4,7 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
+"use strict";
/** @scope modules */
diff --git a/common/content/style.js b/common/content/style.js
index dc206c5f..155416ab 100644
--- a/common/content/style.js
+++ b/common/content/style.js
@@ -2,6 +2,7 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
+"use strict";
/** @scope modules */
diff --git a/common/content/tabs.js b/common/content/tabs.js
index 8373b858..12bc8399 100644
--- a/common/content/tabs.js
+++ b/common/content/tabs.js
@@ -4,7 +4,7 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
-
+"use strict";
/** @scope modules */
diff --git a/common/content/template.js b/common/content/template.js
index 7f8a1f09..c6e822f5 100644
--- a/common/content/template.js
+++ b/common/content/template.js
@@ -2,7 +2,7 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
-
+"use strict";
/** @scope modules */
diff --git a/common/content/util.js b/common/content/util.js
index 6f8857be..07dfc162 100644
--- a/common/content/util.js
+++ b/common/content/util.js
@@ -4,6 +4,7 @@
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
+"use strict";
/** @scope modules */
@@ -267,8 +268,9 @@ const Util = Module("util", {
const PATH = FILE.leafName.replace(/\..*/, "") + "/";
const TIME = Date.now();
+ liberator.initHelp();
let zip = services.create("zipWriter");
- zip.open(FILE, io.MODE_CREATE | io.MODE_WRONLY | io.MODE_TRUNCATE);
+ zip.open(FILE, File.MODE_CREATE | File.MODE_WRONLY | File.MODE_TRUNCATE);
function addURIEntry(file, uri)
zip.addEntryChannel(PATH + file, TIME, 9,
services.get("io").newChannel(uri, null, null), false);
diff --git a/common/modules/storage.jsm b/common/modules/storage.jsm
index 287c6189..264ce186 100644
--- a/common/modules/storage.jsm
+++ b/common/modules/storage.jsm
@@ -19,6 +19,7 @@
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
}}} ***** END LICENSE BLOCK *****/
+"use strict";
var EXPORTED_SYMBOLS = ["storage", "Timer"];
diff --git a/vimperator/components/about-handler.js b/vimperator/components/about-handler.js
index 25dbd492..fc82098a 100644
--- a/vimperator/components/about-handler.js
+++ b/vimperator/components/about-handler.js
@@ -1,4 +1,5 @@
// Header:
+"use strict";
const Name = "Vimperator";
/*
* We can't load our modules here, so the following code is sadly
diff --git a/vimperator/components/commandline-handler.js b/vimperator/components/commandline-handler.js
index 8c23f36d..7d8501ad 100644
--- a/vimperator/components/commandline-handler.js
+++ b/vimperator/components/commandline-handler.js
@@ -1,4 +1,5 @@
// Header:
+"use strict";
const Name = "Vimperator";
/*
* We can't load our modules here, so the following code is sadly