diff options
author | Kris Maglione <maglione.k@gmail.com> | 2011-02-09 07:21:10 -0500 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2011-02-09 07:21:10 -0500 |
commit | 7aed800d29f1c38e75fa947fe05911a4c7605a48 (patch) | |
tree | ddaf49b564d24d1bacf228967bf35b89f9e3a077 /common/modules/template.jsm | |
parent | 8acf2c4ff08febd390fce39ed82599f4dc78cda6 (diff) | |
download | pentadactyl-7aed800d29f1c38e75fa947fe05911a4c7605a48.tar.gz |
Fixes, mostly, most of which should really be in the default branch.
--HG--
branch : groups
Diffstat (limited to 'common/modules/template.jsm')
-rw-r--r-- | common/modules/template.jsm | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/common/modules/template.jsm b/common/modules/template.jsm index d3e7dcd0..be1e5ab7 100644 --- a/common/modules/template.jsm +++ b/common/modules/template.jsm @@ -6,7 +6,7 @@ Components.utils.import("resource://dactyl/bootstrap.jsm"); defineModule("template", { - exports: ["Template", "template"], + exports: ["Binding", "Template", "template"], require: ["util"], use: ["services"] }, this); @@ -14,8 +14,9 @@ defineModule("template", { default xml namespace = XHTML; var Binding = Class("Binding", { - init: function (node) { + init: function (node, nodes) { this.node = node; + this.nodes = nodes; node.dactylBinding = this; Object.defineProperties(node, this.constructor.properties); @@ -32,9 +33,13 @@ var Binding = Class("Binding", { }, get collapsed() !!this.getAttribute("collapsed"), - __noSuchMethod__: function __noSuchMethod__(meth, args) { - return this.node[meth].apply(this.node, args); - } + __noSuchMethod__: Class.Property({ + configurable: true, + writeable: true, + value: function __noSuchMethod__(meth, args) { + return this.node[meth].apply(this.node, args); + } + }) }, { get bindings() { let bindingProto = Object.getPrototypeOf(Binding.prototype); @@ -66,10 +71,12 @@ var Binding = Class("Binding", { for (let obj in this.bindings) for (let prop in properties(obj)) { let desc = Object.getOwnPropertyDescriptor(obj, prop); - for (let k in values(["get", "set", "value"])) - if (typeof desc[k] === "function") - desc[k] = this.bind(desc[k]); - res[prop] = desc; + if (desc.enumerable) { + for (let k in values(["get", "set", "value"])) + if (typeof desc[k] === "function") + desc[k] = this.bind(desc[k]); + res[prop] = desc; + } } return res; }) |