1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-16 18:53:31 +01:00

Make .closure a Proxy and rename .bound

This commit is contained in:
Kris Maglione
2014-03-16 14:32:04 -07:00
parent 03596bd75d
commit af88d531d0
27 changed files with 113 additions and 119 deletions

View File

@@ -107,7 +107,7 @@ var Map = Class("Map", {
*/
hasName: function (name) this.keys.indexOf(name) >= 0,
get keys() array.flatten(this.names.map(mappings.closure.expand)),
get keys() array.flatten(this.names.map(mappings.bound.expand)),
/**
* Execute the action for this mapping.
@@ -171,7 +171,7 @@ var MapHive = Class("MapHive", Contexts.Hive, {
* @param {[Modes.Mode]} modes The modes for which to return mappings.
*/
iterate: function (modes) {
let stacks = Array.concat(modes).map(this.closure.getStack);
let stacks = Array.concat(modes).map(this.bound.getStack);
return values(stacks.shift().sort((m1, m2) => String.localeCompare(m1.name, m2.name))
.filter((map) => map.rhs &&
stacks.every(stack => stack.some(m => m.rhs && m.rhs === map.rhs && m.name === map.name))));