1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 17:37:57 +01:00

Use JS5's strict mode. But, alas! it outlaws octal! Oh the inanity...

--HG--
branch : testing
This commit is contained in:
Kris Maglione
2010-08-15 07:49:52 -04:00
parent f3c32988f1
commit daa2d5dcc5
36 changed files with 44 additions and 23 deletions

View File

@@ -2,7 +2,7 @@
// //
// This work is licensed for reuse under an MIT license. Details are // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // given in the LICENSE.txt file included with this file.
"use strict";
/* Adds support for data: URIs with chrome privileges /* Adds support for data: URIs with chrome privileges
* and fragment identifiers. * and fragment identifiers.

View File

@@ -4,7 +4,7 @@
// //
// This work is licensed for reuse under an MIT license. Details are // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // given in the LICENSE.txt file included with this file.
"use strict";
/** @scope modules */ /** @scope modules */

View File

@@ -2,6 +2,7 @@
// //
// This work is licensed for reuse under an MIT license. Details are // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // given in the LICENSE.txt file included with this file.
"use strict";
const Cc = Components.classes; const Cc = Components.classes;
const Ci = Components.interfaces; const Ci = Components.interfaces;

View File

@@ -4,7 +4,7 @@
// //
// This work is licensed for reuse under an MIT license. Details are // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // given in the LICENSE.txt file included with this file.
"use strict";
const DEFAULT_FAVICON = "chrome://mozapps/skin/places/defaultFavicon.png"; const DEFAULT_FAVICON = "chrome://mozapps/skin/places/defaultFavicon.png";

View File

@@ -4,7 +4,7 @@
// //
// This work is licensed for reuse under an MIT license. Details are // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // given in the LICENSE.txt file included with this file.
"use strict";
/** @scope modules */ /** @scope modules */

View File

@@ -4,7 +4,7 @@
// //
// This work is licensed for reuse under an MIT license. Details are // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // given in the LICENSE.txt file included with this file.
"use strict";
/** @scope modules */ /** @scope modules */

View File

@@ -4,6 +4,7 @@
// //
// This work is licensed for reuse under an MIT license. Details are // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // given in the LICENSE.txt file included with this file.
"use strict";
/** @scope modules */ /** @scope modules */
@@ -971,7 +972,7 @@ const CommandLine = Module("commandline", {
let doc = this._multilineOutputWidget.contentDocument; let doc = this._multilineOutputWidget.contentDocument;
availableHeight = config.outputHeight; let availableHeight = config.outputHeight;
if (!this._outputContainer.collapsed) if (!this._outputContainer.collapsed)
availableHeight += parseFloat(this._outputContainer.height); availableHeight += parseFloat(this._outputContainer.height);
doc.body.style.minWidth = this._commandlineWidget.scrollWidth + "px"; doc.body.style.minWidth = this._commandlineWidget.scrollWidth + "px";

View File

@@ -4,7 +4,7 @@
// //
// This work is licensed for reuse under an MIT license. Details are // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // given in the LICENSE.txt file included with this file.
"use strict";
/** @scope modules */ /** @scope modules */

View File

@@ -4,7 +4,7 @@
// //
// This work is licensed for reuse under an MIT license. Details are // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // given in the LICENSE.txt file included with this file.
"use strict";
/** @scope modules */ /** @scope modules */
@@ -412,12 +412,12 @@ const CompletionContext = Class("CompletionContext", {
let filter = fixCase(this.filter); let filter = fixCase(this.filter);
if (this.anchored) { if (this.anchored) {
var compare = function compare(text, s) text.substr(0, s.length) == s; 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)); function (end) text.substring(0, end));
} }
else { else {
var compare = function compare(text, s) text.indexOf(s) >= 0; var compare = function compare(text, s) text.indexOf(s) >= 0;
substrings = []; var substrings = [];
let start = 0; let start = 0;
let idx; let idx;
let length = filter.length; let length = filter.length;

View File

@@ -4,6 +4,7 @@
// //
// This work is licensed for reuse under an MIT license. Details are // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // given in the LICENSE.txt file included with this file.
"use strict";
const ConfigBase = Class(ModuleBase, { const ConfigBase = Class(ModuleBase, {
/** /**

View File

@@ -2,7 +2,7 @@
// //
// This work is licensed for reuse under an MIT license. Details are // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // given in the LICENSE.txt file included with this file.
"use strict";
/** @scope modules */ /** @scope modules */

View File

@@ -4,7 +4,7 @@
// //
// This work is licensed for reuse under an MIT license. Details are // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // given in the LICENSE.txt file included with this file.
"use strict";
/** @scope modules */ /** @scope modules */

View File

@@ -2,6 +2,7 @@
// //
// This work is licensed for reuse under an MIT license. Details are // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // given in the LICENSE.txt file included with this file.
"use strict";
/** @scope modules */ /** @scope modules */

View File

@@ -2,7 +2,7 @@
// //
// This work is licensed for reuse under an MIT license. Details are // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // given in the LICENSE.txt file included with this file.
"use strict";
function checkFragment() { function checkFragment() {
document.title = document.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "title")[0].textContent; document.title = document.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "title")[0].textContent;

View File

@@ -4,7 +4,7 @@
// //
// This work is licensed for reuse under an MIT license. Details are // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // given in the LICENSE.txt file included with this file.
"use strict";
/** @scope modules */ /** @scope modules */
/** @instance hints */ /** @instance hints */

View File

@@ -4,6 +4,7 @@
// //
// This work is licensed for reuse under an MIT license. Details are // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // given in the LICENSE.txt file included with this file.
"use strict";
const History = Module("history", { const History = Module("history", {
requires: ["config"], requires: ["config"],

View File

@@ -5,7 +5,7 @@
// //
// This work is licensed for reuse under an MIT license. Details are // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // given in the LICENSE.txt file included with this file.
"use strict";
/** @scope modules */ /** @scope modules */
@@ -162,7 +162,7 @@ const File = Class("File", {
mode = File.MODE_WRONLY | File.MODE_CREATE | File.MODE_TRUNCATE; mode = File.MODE_WRONLY | File.MODE_CREATE | File.MODE_TRUNCATE;
if (!perms) if (!perms)
perms = 0644; perms = parseInt('0644', 8);
ofstream.init(this, mode, perms, 0); ofstream.init(this, mode, perms, 0);
let ocstream = getStream(0); let ocstream = getStream(0);
@@ -487,7 +487,7 @@ const IO = Module("io", {
let file = services.get("directory").get("TmpD", Ci.nsIFile); let file = services.get("directory").get("TmpD", Ci.nsIFile);
file.append(config.tempFile); 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); return File(file);
}, },

View File

@@ -2,6 +2,7 @@
// //
// This work is licensed for reuse under an MIT license. Details are // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // given in the LICENSE.txt file included with this file.
"use strict";
// TODO: Clean this up. // TODO: Clean this up.
@@ -109,7 +110,7 @@ const JavaScript = Module("javascript", {
return completions; return completions;
}, },
eval: function eval(arg, key, tmp) { eval: function evalstr(arg, key, tmp) {
let cache = this.context.cache.eval; let cache = this.context.cache.eval;
let context = this.context.cache.evalContext; let context = this.context.cache.evalContext;

View File

@@ -2,6 +2,7 @@
// //
// This work is licensed for reuse under an MIT license. Details are // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // given in the LICENSE.txt file included with this file.
"use strict";
(function () { (function () {
const modules = {}; const modules = {};

View File

@@ -4,7 +4,7 @@
// //
// This work is licensed for reuse under an MIT license. Details are // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // given in the LICENSE.txt file included with this file.
"use strict";
/** @scope modules */ /** @scope modules */

View File

@@ -4,7 +4,7 @@
// //
// This work is licensed for reuse under an MIT license. Details are // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // given in the LICENSE.txt file included with this file.
"use strict";
/** @scope modules */ /** @scope modules */

View File

@@ -4,6 +4,7 @@
// //
// This work is licensed for reuse under an MIT license. Details are // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // given in the LICENSE.txt file included with this file.
"use strict";
/** /**
* @scope modules * @scope modules

View File

@@ -4,6 +4,7 @@
// //
// This work is licensed for reuse under an MIT license. Details are // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // given in the LICENSE.txt file included with this file.
"use strict";
/** @scope modules */ /** @scope modules */

View File

@@ -2,6 +2,7 @@
// //
// This work is licensed for reuse under an MIT license. Details are // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // given in the LICENSE.txt file included with this file.
"use strict";
/** /**
* @class ModuleBase * @class ModuleBase

View File

@@ -4,6 +4,7 @@
// //
// This work is licensed for reuse under an MIT license. Details are // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // given in the LICENSE.txt file included with this file.
"use strict";
/** @scope modules */ /** @scope modules */

View File

@@ -4,6 +4,7 @@
// //
// This work is licensed for reuse under an MIT license. Details are // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // given in the LICENSE.txt file included with this file.
"use strict";
/** @scope modules */ /** @scope modules */

View File

@@ -2,6 +2,7 @@
// //
// This work is licensed for reuse under an MIT license. Details are // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // given in the LICENSE.txt file included with this file.
"use strict";
// TODO: // TODO:
// - fix Sanitize autocommand // - fix Sanitize autocommand

View File

@@ -2,6 +2,7 @@
// //
// This work is licensed for reuse under an MIT license. Details are // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // given in the LICENSE.txt file included with this file.
"use strict";
/** @scope modules */ /** @scope modules */

View File

@@ -4,6 +4,7 @@
// //
// This work is licensed for reuse under an MIT license. Details are // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // given in the LICENSE.txt file included with this file.
"use strict";
/** @scope modules */ /** @scope modules */

View File

@@ -2,6 +2,7 @@
// //
// This work is licensed for reuse under an MIT license. Details are // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // given in the LICENSE.txt file included with this file.
"use strict";
/** @scope modules */ /** @scope modules */

View File

@@ -4,7 +4,7 @@
// //
// This work is licensed for reuse under an MIT license. Details are // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // given in the LICENSE.txt file included with this file.
"use strict";
/** @scope modules */ /** @scope modules */

View File

@@ -2,7 +2,7 @@
// //
// This work is licensed for reuse under an MIT license. Details are // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // given in the LICENSE.txt file included with this file.
"use strict";
/** @scope modules */ /** @scope modules */

View File

@@ -4,6 +4,7 @@
// //
// This work is licensed for reuse under an MIT license. Details are // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // given in the LICENSE.txt file included with this file.
"use strict";
/** @scope modules */ /** @scope modules */
@@ -267,8 +268,9 @@ const Util = Module("util", {
const PATH = FILE.leafName.replace(/\..*/, "") + "/"; const PATH = FILE.leafName.replace(/\..*/, "") + "/";
const TIME = Date.now(); const TIME = Date.now();
liberator.initHelp();
let zip = services.create("zipWriter"); 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) function addURIEntry(file, uri)
zip.addEntryChannel(PATH + file, TIME, 9, zip.addEntryChannel(PATH + file, TIME, 9,
services.get("io").newChannel(uri, null, null), false); services.get("io").newChannel(uri, null, null), false);

View File

@@ -19,6 +19,7 @@
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE. DEALINGS IN THE SOFTWARE.
}}} ***** END LICENSE BLOCK *****/ }}} ***** END LICENSE BLOCK *****/
"use strict";
var EXPORTED_SYMBOLS = ["storage", "Timer"]; var EXPORTED_SYMBOLS = ["storage", "Timer"];

View File

@@ -1,4 +1,5 @@
// Header: // Header:
"use strict";
const Name = "Vimperator"; const Name = "Vimperator";
/* /*
* We can't load our modules here, so the following code is sadly * We can't load our modules here, so the following code is sadly

View File

@@ -1,4 +1,5 @@
// Header: // Header:
"use strict";
const Name = "Vimperator"; const Name = "Vimperator";
/* /*
* We can't load our modules here, so the following code is sadly * We can't load our modules here, so the following code is sadly