mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-11 09:45:46 +01:00
Death to E4X and stuff.
This commit is contained in:
@@ -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 */
|
"use strict";
|
||||||
|
|
||||||
var { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
|
var { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
|
||||||
|
|
||||||
@@ -146,7 +146,7 @@ defineModule("base", {
|
|||||||
"debuggerProperties", "defineModule", "deprecated", "endModule", "forEach", "isArray",
|
"debuggerProperties", "defineModule", "deprecated", "endModule", "forEach", "isArray",
|
||||||
"isGenerator", "isinstance", "isObject", "isString", "isSubclass", "isXML", "iter", "iterAll",
|
"isGenerator", "isinstance", "isObject", "isString", "isSubclass", "isXML", "iter", "iterAll",
|
||||||
"iterOwnProperties", "keys", "memoize", "octal", "properties", "require", "set", "update",
|
"iterOwnProperties", "keys", "memoize", "octal", "properties", "require", "set", "update",
|
||||||
"values", "withCallerGlobal"
|
"values"
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -573,18 +573,6 @@ function memoize(obj, key, getter) {
|
|||||||
|
|
||||||
let sandbox = Cu.Sandbox(Cu.getGlobalForObject(this));
|
let sandbox = Cu.Sandbox(Cu.getGlobalForObject(this));
|
||||||
sandbox.__proto__ = this;
|
sandbox.__proto__ = this;
|
||||||
/**
|
|
||||||
* Wraps a function so that when called, the global object of the caller
|
|
||||||
* is prepended to its arguments.
|
|
||||||
*/
|
|
||||||
// Hack to get around lack of access to caller in strict mode.
|
|
||||||
var withCallerGlobal = Cu.evalInSandbox(<![CDATA[
|
|
||||||
(function withCallerGlobal(fn)
|
|
||||||
function withCallerGlobal_wrapped()
|
|
||||||
fn.apply(this,
|
|
||||||
[Class.objectGlobal(withCallerGlobal_wrapped.caller)]
|
|
||||||
.concat(Array.slice(arguments))))
|
|
||||||
]]>, Cu.Sandbox(Cu.getGlobalForObject(this)), "1.8");
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates an object with the properties of another object. Getters
|
* Updates an object with the properties of another object. Getters
|
||||||
@@ -677,17 +665,17 @@ function Class() {
|
|||||||
return res !== undefined ? res : self;
|
return res !== undefined ? res : self;
|
||||||
};
|
};
|
||||||
else
|
else
|
||||||
var Constructor = eval(String.replace(<![CDATA[
|
var Constructor = eval(String.replace('\n\
|
||||||
(function constructor(PARAMS) {
|
(function constructor(PARAMS) { \n\
|
||||||
var self = Object.create(Constructor.prototype);
|
var self = Object.create(Constructor.prototype); \n\
|
||||||
self.instance = self;
|
self.instance = self; \n\
|
||||||
|
\n\
|
||||||
if ("_metaInit_" in self && self._metaInit_)
|
if ("_metaInit_" in self && self._metaInit_) \n\
|
||||||
self._metaInit_.apply(self, arguments);
|
self._metaInit_.apply(self, arguments); \n\
|
||||||
|
\n\
|
||||||
var res = self.init.apply(self, arguments);
|
var res = self.init.apply(self, arguments); \n\
|
||||||
return res !== undefined ? res : self;
|
return res !== undefined ? res : self; \n\
|
||||||
})]]>,
|
})',
|
||||||
"constructor", (name || superclass.className).replace(/\W/g, "_"))
|
"constructor", (name || superclass.className).replace(/\W/g, "_"))
|
||||||
.replace("PARAMS", /^function .*?\((.*?)\)/.exec(args[0] && args[0].init || Class.prototype.init)[1]
|
.replace("PARAMS", /^function .*?\((.*?)\)/.exec(args[0] && args[0].init || Class.prototype.init)[1]
|
||||||
.replace(/\b(self|res|Constructor)\b/g, "$1_")));
|
.replace(/\b(self|res|Constructor)\b/g, "$1_")));
|
||||||
|
|||||||
@@ -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 */
|
"use strict";
|
||||||
|
|
||||||
defineModule("bookmarkcache", {
|
defineModule("bookmarkcache", {
|
||||||
exports: ["Bookmark", "BookmarkCache", "Keyword", "bookmarkcache"],
|
exports: ["Bookmark", "BookmarkCache", "Keyword", "bookmarkcache"],
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
//
|
//
|
||||||
// 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 */
|
"use strict";
|
||||||
|
|
||||||
var EXPORTED_SYMBOLS = ["require"];
|
var EXPORTED_SYMBOLS = ["require"];
|
||||||
|
|
||||||
// Deal with cross-compartment XML passing issues.
|
// Deal with cross-compartment XML passing issues.
|
||||||
function create(proto) Object.create(proto);
|
function create(proto) Object.create(proto);
|
||||||
function import(obj) {
|
this["import"] = function import_(obj) {
|
||||||
let res = {};
|
let res = {};
|
||||||
for each (let key in Object.getOwnPropertyNames(obj))
|
for each (let key in Object.getOwnPropertyNames(obj))
|
||||||
Object.defineProperty(res, key, Object.getOwnPropertyDescriptor(obj, key));
|
Object.defineProperty(res, key, Object.getOwnPropertyDescriptor(obj, key));
|
||||||
|
|||||||
@@ -868,7 +868,7 @@ var Buffer = Module("Buffer", {
|
|||||||
|
|
||||||
// add the frame indicator
|
// add the frame indicator
|
||||||
let doc = frames[next].document;
|
let doc = frames[next].document;
|
||||||
let indicator = DOM(<div highlight="FrameIndicator"/>, doc)
|
let indicator = DOM(["div", { highlight: "FrameIndicator" }], doc)
|
||||||
.appendTo(doc.body || doc.documentElement || doc);
|
.appendTo(doc.body || doc.documentElement || doc);
|
||||||
|
|
||||||
util.timeout(function () { indicator.remove(); }, 500);
|
util.timeout(function () { indicator.remove(); }, 500);
|
||||||
@@ -1533,7 +1533,7 @@ var Buffer = Module("Buffer", {
|
|||||||
|
|
||||||
_exWidth: function _exWidth(elem) {
|
_exWidth: function _exWidth(elem) {
|
||||||
try {
|
try {
|
||||||
let div = DOM(<elem style="width: 1ex !important; position: absolute !important; padding: 0 !important; display: block;"/>,
|
let div = DOM(["elem", { style: "width: 1ex !important; position: absolute !important; padding: 0 !important; display: block;" }],
|
||||||
elem.ownerDocument).appendTo(elem.body || elem);
|
elem.ownerDocument).appendTo(elem.body || elem);
|
||||||
try {
|
try {
|
||||||
return parseFloat(div.style.width);
|
return parseFloat(div.style.width);
|
||||||
|
|||||||
@@ -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 */
|
"use strict";
|
||||||
|
|
||||||
defineModule("cache", {
|
defineModule("cache", {
|
||||||
exports: ["Cache", "cache"],
|
exports: ["Cache", "cache"],
|
||||||
|
|||||||
@@ -753,38 +753,34 @@ var Commands = Module("commands", {
|
|||||||
|
|
||||||
let hives = (hives || this.userHives).map(function (h) [h, cmds(h)]).filter(function ([h, c]) c.length);
|
let hives = (hives || this.userHives).map(function (h) [h, cmds(h)]).filter(function ([h, c]) c.length);
|
||||||
|
|
||||||
let list = <table>
|
let list = ["table", {},
|
||||||
<tr highlight="Title">
|
["tr", { highlight: "Title" },
|
||||||
<td/>
|
["td"],
|
||||||
<td style="padding-right: 1em;"></td>
|
["td", { style: "padding-right: 1em;" }],
|
||||||
<td style="padding-right: 1ex;">{_("title.Name")}</td>
|
["td", { style: "padding-right: 1ex;" }, _("title.Name")],
|
||||||
<td style="padding-right: 1ex;">{_("title.Args")}</td>
|
["td", { style: "padding-right: 1ex;" }, _("title.Args")],
|
||||||
<td style="padding-right: 1ex;">{_("title.Range")}</td>
|
["td", { style: "padding-right: 1ex;" }, _("title.Range")],
|
||||||
<td style="padding-right: 1ex;">{_("title.Complete")}</td>
|
["td", { style: "padding-right: 1ex;" }, _("title.Complete")],
|
||||||
<td style="padding-right: 1ex;">{_("title.Definition")}</td>
|
["td", { style: "padding-right: 1ex;" }, _("title.Definition")]],
|
||||||
</tr>
|
["col", { style: "min-width: 6em; padding-right: 1em;" }],
|
||||||
<col style="min-width: 6em; padding-right: 1em;"/>
|
hives.map(function ([hive, cmds]) let (i = 0) [
|
||||||
{
|
["tr", { style: "height: .5ex;" }],
|
||||||
template.map(hives, function ([hive, cmds]) let (i = 0)
|
cmds.map(function (cmd)
|
||||||
<tr style="height: .5ex;"/> +
|
["tr", {},
|
||||||
template.map(cmds, function (cmd)
|
["td", { highlight: "Title" }, !i++ ? hive.name : ""],
|
||||||
<tr>
|
["td", {}, cmd.bang ? "!" : " "],
|
||||||
<td highlight="Title">{!i++ ? hive.name : ""}</td>
|
["td", {}, cmd.name],
|
||||||
<td>{cmd.bang ? "!" : " "}</td>
|
["td", {}, cmd.argCount],
|
||||||
<td>{cmd.name}</td>
|
["td", {}, cmd.count ? "0c" : ""],
|
||||||
<td>{cmd.argCount}</td>
|
["td", {}, completerToString(cmd.completer)],
|
||||||
<td>{cmd.count ? "0c" : ""}</td>
|
["td", {}, cmd.replacementText || "function () { ... }"]]),
|
||||||
<td>{completerToString(cmd.completer)}</td>
|
["tr", { style: "height: .5ex;" }]])];
|
||||||
<td>{cmd.replacementText || "function () { ... }"}</td>
|
|
||||||
</tr>) +
|
|
||||||
<tr style="height: .5ex;"/>)
|
|
||||||
}
|
|
||||||
</table>;
|
|
||||||
|
|
||||||
if (list.*.length() === list.text().length() + 2)
|
// E4X-FIXME
|
||||||
dactyl.echomsg(_("command.none"));
|
// if (list.*.length() === list.text().length() + 2)
|
||||||
else
|
// dactyl.echomsg(_("command.none"));
|
||||||
commandline.commandOutput(list);
|
// else
|
||||||
|
commandline.commandOutput(list);
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user