vendor/components/indefinido-observable/lib/observable.js in ende-0.4.20 vs vendor/components/indefinido-observable/lib/observable.js in ende-0.4.21

- old
+ new

@@ -221,34 +221,24 @@ enumerable: true }); }, observable_for: function (object) { - var toJSON; - Object.defineProperty(object, 'observed', { configurable: true, enumerable: false, value: {} }); - // TODO remove json in favor of the toJSON convention - toJSON = object.json || object.toJSON - - if (toJSON) { - return Object.defineProperty(object, 'toJSON', { - enumerable: false, - value: function () { - var json; - - // TODO remove underscore dependency - // TODO ? move toJSON and observed to other methods - json = toJSON.apply(this, arguments); - return observable.unobserve(_.omit(json, observable.ignores, ['toJSON', 'observed'])); - } - }); - - } + // TODO call the current object.toJSON after this method + return Object.defineProperty(object, 'toJSON', { + enumerable: false, + value: function () { + // TODO remove underscore dependency + return observable.unobserve(_.omit(this, observable.ignores)); + // old_to_json() + } + }); }, // TODO improve readability // TODO implement linked list setter: function subscribed_setter (keypath, callback) {