diff options
author | Kris Maglione <maglione.k@gmail.com> | 2011-02-05 03:02:36 -0500 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2011-02-05 03:02:36 -0500 |
commit | 9b3ad1c7c6b2a8afd11ea6a392e38666c5aafd01 (patch) | |
tree | e10448b0249ca8e3fbad84c84af019a8c16b365e /common/modules/base.jsm | |
parent | e9fd99dafa8e9ed0f479143ad098c96889e31e1b (diff) | |
download | pentadactyl-9b3ad1c7c6b2a8afd11ea6a392e38666c5aafd01.tar.gz |
imported patch groups
--HG--
branch : groups
Diffstat (limited to 'common/modules/base.jsm')
-rw-r--r-- | common/modules/base.jsm | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/common/modules/base.jsm b/common/modules/base.jsm index c3da6d2c..f147ebf1 100644 --- a/common/modules/base.jsm +++ b/common/modules/base.jsm @@ -616,12 +616,12 @@ function update(target) { if (desc.value instanceof Class.Property) desc = desc.value.init(k) || desc.value; if (typeof desc.value == "function" && Object.getPrototypeOf(target)) { - let func = desc.value; - desc.value.__defineGetter__("super", function () Object.getPrototypeOf(target)[k]); - desc.value.superapply = function superapply(self, args) + let func = desc.value.wrapped || desc.value; + func.__defineGetter__("super", function () Object.getPrototypeOf(target)[k]); + func.superapply = function superapply(self, args) let (meth = Object.getPrototypeOf(target)[k]) meth && meth.apply(self, args); - desc.value.supercall = function supercall(self) + func.supercall = function supercall(self) func.superapply(self, Array.slice(arguments, 1)); } Object.defineProperty(target, k, desc); @@ -663,7 +663,7 @@ function Class() { superclass = args.shift(); var Constructor = eval(String.replace(<![CDATA[ - (function constructor() { + (function constructor(PARAMS) { var self = Object.create(Constructor.prototype, { constructor: { value: Constructor }, }); @@ -671,7 +671,9 @@ function Class() { var res = self.init.apply(self, arguments); return res !== undefined ? res : self; })]]>, - "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])); + Constructor.className = name || superclass.className || superclass.name; if ("init" in superclass.prototype) |