mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-23 18:45:52 +01:00
Fix arg maps.
This commit is contained in:
@@ -133,7 +133,7 @@ install:
|
|||||||
fi; \
|
fi; \
|
||||||
\
|
\
|
||||||
ext="$$profile/extensions/$(UUID)"; \
|
ext="$$profile/extensions/$(UUID)"; \
|
||||||
mkdir -p "$$(dirname "$$ext")"; \
|
mkdir -p "$$(dirname "$$ext")"; \
|
||||||
rm -rf "$$ext.xpi" "$$ext"; \
|
rm -rf "$$ext.xpi" "$$ext"; \
|
||||||
echo "Installing to $$ext"; \
|
echo "Installing to $$ext"; \
|
||||||
if which cygpath >/dev/null 2>&1; \
|
if which cygpath >/dev/null 2>&1; \
|
||||||
|
|||||||
@@ -1122,7 +1122,7 @@ var Events = Module("events", {
|
|||||||
[map] = this.pendingMap || [];
|
[map] = this.pendingMap || [];
|
||||||
this.pendingMap = null;
|
this.pendingMap = null;
|
||||||
if (map && map.arg)
|
if (map && map.arg)
|
||||||
this.pendingArgMap = map;
|
this.pendingArgMap = [map, command];
|
||||||
}
|
}
|
||||||
|
|
||||||
// counts must be at the start of a complete mapping (10j -> go 10 lines down)
|
// counts must be at the start of a complete mapping (10j -> go 10 lines down)
|
||||||
|
|||||||
@@ -488,6 +488,14 @@ function call(fn) {
|
|||||||
* value of the property.
|
* value of the property.
|
||||||
*/
|
*/
|
||||||
function memoize(obj, key, getter) {
|
function memoize(obj, key, getter) {
|
||||||
|
if (arguments.length == 1) {
|
||||||
|
for (let prop in Object.getOwnPropertyNames(obj)) {
|
||||||
|
let get = objproto.__lookupGetter__.call(obj, prop);
|
||||||
|
if (get)
|
||||||
|
memoize(obj, prop, get);
|
||||||
|
}
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
obj.__defineGetter__(key, function g_replaceProperty() (
|
obj.__defineGetter__(key, function g_replaceProperty() (
|
||||||
Class.replaceProperty(this.instance || this, key, null),
|
Class.replaceProperty(this.instance || this, key, null),
|
||||||
Class.replaceProperty(this.instance || this, key, getter.call(this, key))));
|
Class.replaceProperty(this.instance || this, key, getter.call(this, key))));
|
||||||
|
|||||||
@@ -761,7 +761,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
|||||||
isDomainURL: function isDomainURL(url, domain) util.isSubdomain(util.getHost(url), domain),
|
isDomainURL: function isDomainURL(url, domain) util.isSubdomain(util.getHost(url), domain),
|
||||||
|
|
||||||
/** Dactyl's notion of the current operating system platform. */
|
/** Dactyl's notion of the current operating system platform. */
|
||||||
OS: {
|
OS: memoize({
|
||||||
_arch: services.runtime.OS,
|
_arch: services.runtime.OS,
|
||||||
/**
|
/**
|
||||||
* @property {string} The normalised name of the OS. This is one of
|
* @property {string} The normalised name of the OS. This is one of
|
||||||
@@ -776,7 +776,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
|||||||
get isUnix() !this.isWindows && !this.isMacOSX,
|
get isUnix() !this.isWindows && !this.isMacOSX,
|
||||||
/** @property {RegExp} A RegExp which matches illegal characters in path components. */
|
/** @property {RegExp} A RegExp which matches illegal characters in path components. */
|
||||||
get illegalCharacters() this.isWindows ? /[<>:"/\\|?*\x00-\x1f]/ : /\//
|
get illegalCharacters() this.isWindows ? /[<>:"/\\|?*\x00-\x1f]/ : /\//
|
||||||
},
|
}),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if *host* is a subdomain of *domain*.
|
* Returns true if *host* is a subdomain of *domain*.
|
||||||
|
|||||||
Reference in New Issue
Block a user