Simplified SAVE STATE events, added wrap method to easily build decorators

This commit is contained in:
juliandescottes
2014-04-20 13:15:30 +02:00
parent 8335c07519
commit c2a3ccc8d0
11 changed files with 119 additions and 201 deletions

View File

@@ -47,5 +47,13 @@ if (typeof Function.prototype.bind !== "function") {
extendedObject.prototype.superclass = inheritFrom.prototype;
};
ns.wrap = function (wrapper, wrappedObject) {
for (var prop in wrappedObject) {
if (typeof wrappedObject[prop] === 'function') {
wrapper[prop] = wrappedObject[prop].bind(wrappedObject);
}
}
};
})();