mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-21 10:45:46 +01:00
Small fixes. Add Components to list of magical JS global properties.
--HG-- extra : rebase_source : ba08f90f02d5362108cfbffd2f9ce9a89d8e905e
This commit is contained in:
@@ -607,7 +607,7 @@ const JavaScript = Module("javascript", {
|
|||||||
* enumerable by any standard method.
|
* enumerable by any standard method.
|
||||||
*/
|
*/
|
||||||
globalNames: Class.memoize(function () array.uniq([
|
globalNames: Class.memoize(function () array.uniq([
|
||||||
"Array", "ArrayBuffer", "AttributeName", "Boolean",
|
"Array", "ArrayBuffer", "AttributeName", "Boolean", "Components",
|
||||||
"CSSFontFaceStyleDecl", "CSSGroupRuleRuleList", "CSSNameSpaceRule",
|
"CSSFontFaceStyleDecl", "CSSGroupRuleRuleList", "CSSNameSpaceRule",
|
||||||
"CSSRGBColor", "CSSRect", "ComputedCSSStyleDeclaration", "Date",
|
"CSSRGBColor", "CSSRect", "ComputedCSSStyleDeclaration", "Date",
|
||||||
"Error", "EvalError", "Float32Array", "Float64Array", "Function",
|
"Error", "EvalError", "Float32Array", "Float64Array", "Function",
|
||||||
|
|||||||
@@ -752,7 +752,7 @@ const Options = Module("options", {
|
|||||||
let matches, prefix, postfix, valueGiven;
|
let matches, prefix, postfix, valueGiven;
|
||||||
|
|
||||||
[matches, prefix, ret.name, postfix, valueGiven, ret.operator, ret.value] =
|
[matches, prefix, ret.name, postfix, valueGiven, ret.operator, ret.value] =
|
||||||
args.match(/^\s*(no|inv)?([a-z_-]*?)([?&!])?\s*(([-+^]?)=(.*))?\s*$/) || [];
|
args.match(/^\s*(no|inv)?([a-z_.-]*?)([?&!])?\s*(([-+^]?)=(.*))?\s*$/) || [];
|
||||||
|
|
||||||
ret.args = args;
|
ret.args = args;
|
||||||
ret.onlyNonDefault = false; // used for :set to print non-default options
|
ret.onlyNonDefault = false; // used for :set to print non-default options
|
||||||
@@ -1089,9 +1089,7 @@ const Options = Module("options", {
|
|||||||
},
|
},
|
||||||
update({
|
update({
|
||||||
bang: true,
|
bang: true,
|
||||||
completer: function (context, args) {
|
completer: setCompleter,
|
||||||
return setCompleter(context, args);
|
|
||||||
},
|
|
||||||
domains: function (args) array.flatten(args.map(function (spec) {
|
domains: function (args) array.flatten(args.map(function (spec) {
|
||||||
try {
|
try {
|
||||||
let opt = options.parseOpt(spec);
|
let opt = options.parseOpt(spec);
|
||||||
|
|||||||
@@ -377,14 +377,14 @@ const Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakR
|
|||||||
let items = args.slice();
|
let items = args.slice();
|
||||||
if (args.bang) {
|
if (args.bang) {
|
||||||
dactyl.assert(args.length == 0, "E488: Trailing characters");
|
dactyl.assert(args.length == 0, "E488: Trailing characters");
|
||||||
items = Object.keys(sanitizer.itemDescriptions).filter(
|
items = Object.keys(sanitizer.itemMap).filter(
|
||||||
function (k) modules.options.get("sanitizeitems").has(k));
|
function (k) modules.options.get("sanitizeitems").has(k));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
dactyl.assert(modules.options.get("sanitizeitems").validator(items), "Valid items required");
|
dactyl.assert(modules.options.get("sanitizeitems").validator(items), "Valid items required");
|
||||||
|
|
||||||
if (items.indexOf("all") >= 0)
|
if (items.indexOf("all") >= 0)
|
||||||
items = Object.keys(sanitizer.itemDescriptions).filter(function (k) items.indexOf(k) === -1);
|
items = Object.keys(sanitizer.itemMap).filter(function (k) items.indexOf(k) === -1);
|
||||||
|
|
||||||
sanitizer.range = range;
|
sanitizer.range = range;
|
||||||
sanitizer.ignoreTimespan = range.min == null;
|
sanitizer.ignoreTimespan = range.min == null;
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ const Services = Module("Services", {
|
|||||||
Components.utils.import("resource://gre/modules/AddonManager.jsm", modules);
|
Components.utils.import("resource://gre/modules/AddonManager.jsm", modules);
|
||||||
},
|
},
|
||||||
javascript: function (dactyl, modules) {
|
javascript: function (dactyl, modules) {
|
||||||
modules.JavaScript.setCompleter(this.get, [function () services.services]);
|
modules.JavaScript.setCompleter(this.get, [function () [[k, v] for ([k, v] in Iterator(services)) if (v instanceof Ci.nsISupports)]]);
|
||||||
modules.JavaScript.setCompleter(this.create, [function () [[c, ""] for (c in services.classes)]]);
|
modules.JavaScript.setCompleter(this.create, [function () [[c, ""] for (c in services.classes)]]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ const Template = Module("Template", {
|
|||||||
let n = 0;
|
let n = 0;
|
||||||
for (let [i, length] in iter) {
|
for (let [i, length] in iter) {
|
||||||
if (n++ > 50) // Prevent infinite loops.
|
if (n++ > 50) // Prevent infinite loops.
|
||||||
return s + <>{str.substr(start)}</>;
|
break;
|
||||||
XML.ignoreWhitespace = false;
|
XML.ignoreWhitespace = false;
|
||||||
s += <>{str.substring(start, i)}</>;
|
s += <>{str.substring(start, i)}</>;
|
||||||
s += highlight(str.substr(i, length));
|
s += highlight(str.substr(i, length));
|
||||||
|
|||||||
Reference in New Issue
Block a user