From 48fac704eeff082d5c3cee9d6ff35f229cda24a7 Mon Sep 17 00:00:00 2001 From: Erik Bryn Date: Wed, 19 Oct 2011 16:17:33 -0700 Subject: [PATCH] Remove SC.Binding's dependency on SC.Object --- .../sproutcore-runtime/lib/system/binding.js | 36 ++++++++++++++----- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/packages/sproutcore-runtime/lib/system/binding.js b/packages/sproutcore-runtime/lib/system/binding.js index f2fa6581c74..c07e5ed9eec 100644 --- a/packages/sproutcore-runtime/lib/system/binding.js +++ b/packages/sproutcore-runtime/lib/system/binding.js @@ -317,17 +317,29 @@ var OR_OPERATION = function(obj, left, right) { @since SproutCore 1.0 */ -var Binding = SC.Object.extend({ - +var K = function() {}; +var Binding = function(toPath, fromPath) { + var self; + + if (this instanceof Binding) { + self = this; + } else { + self = new K(); + } + /** @private */ - _direction: 'fwd', + self._direction = 'fwd'; /** @private */ - init: function(toPath, fromPath) { - this._from = fromPath; - this._to = toPath; - }, + self._from = fromPath; + self._to = toPath; + + return self; +}; + +K.prototype = Binding.prototype; +Binding.prototype = { // .......................................................... // CONFIG // @@ -678,7 +690,15 @@ var Binding = SC.Object.extend({ } } -}); +}; + +Binding.reopenClass = function(classMethods) { + for (var key in classMethods) { + if (typeof classMethods[key] === 'function') { + Binding[key] = classMethods[key]; + } + } +}; Binding.reopenClass(/** @scope SC.Binding */ {