[Qooxdoo-commit] qooxdoo/source/script/core QxObject.js,1.2.2.37,1.2.2.38
Brought to you by:
ecker,
martinwittemann
|
From: Sebastian W. <wp...@us...> - 2006-01-31 12:25:36
|
Update of /cvsroot/qooxdoo/qooxdoo/source/script/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24373/source/script/core Modified Files: Tag: renderer QxObject.js Log Message: Improved common dispose method for properties, minor comments added, some restructuring Index: QxObject.js =================================================================== RCS file: /cvsroot/qooxdoo/qooxdoo/source/script/core/QxObject.js,v retrieving revision 1.2.2.37 retrieving revision 1.2.2.38 diff -u -d -r1.2.2.37 -r1.2.2.38 --- QxObject.js 28 Jan 2006 18:19:24 -0000 1.2.2.37 +++ QxObject.js 31 Jan 2006 12:25:23 -0000 1.2.2.38 @@ -42,7 +42,7 @@ { this._hashCode = QxObjectCounter++; - if (vAutoDispose != false) { + if (vAutoDispose !== false) { QxObjectDataBase.push(this); }; }; @@ -59,6 +59,9 @@ --------------------------------------------------------------------------- */ +/*! + Returns a string represantation of the qooxdoo object. +*/ proto.toString = function() { if(this.classname) { @@ -68,11 +71,26 @@ return "[object Object]"; }; +/*! + Return unique hash code of object +*/ proto.toHashCode = function() { return this._hashCode; }; +/*! + Returns true if the object is disposed. +*/ +proto.getDisposed = function() { + return this._disposed; +}; +/*! + Returns true if the object is disposed. +*/ +proto.isDisposed = function() { + return this._disposed; +}; @@ -85,18 +103,30 @@ --------------------------------------------------------------------------- */ +/*! + Print out a debug message to the qooxdoo debug console. +*/ proto.debug = function(m, c) { QxDebug(this.classname + QxObject.DEBUG_MSG_BEFORE + this._hashCode + QxObject.DEBUG_MSG_AFTER, m, c); }; +/*! + Print out an info message info to the qooxdoo debug console. +*/ proto.info = function(m, c) { this.debug(m, "info"); }; +/*! + Print out an warning to the qooxdoo debug console. +*/ proto.warn = function(m, c) { this.debug(m, "warning"); }; +/*! + Print out an error to the qooxdoo debug console. +*/ proto.error = function(m, f) { if (QxUtil.isValidString(f)) @@ -366,7 +396,7 @@ return; }; - // Dispose data + // Dispose (user) data if (this._data) { for(var p in this._data) { @@ -376,34 +406,19 @@ this._data = null; }; - // Delete Entry from Object DB - QxObjectDataBase[this._hashCode] = null; - delete QxObjectDataBase[this._hashCode]; - - // Finally cleanup the other stuff - for (var obj in this) + // Finally cleanup properties + if (this._objectproperties) { - if (typeof this[obj] == QxConst.TYPEOF_OBJECT) - { - this[obj] = null; - delete this[obj]; + var a = this._objectproperties.split(QxConst.CORE_COMMA); + for (var i=0, l=a.length; i<l; i++) { + delete this[QxValues[a[i]]]; }; }; + // Delete Entry from Object DB + QxObjectDataBase[this._hashCode] = null; + delete QxObjectDataBase[this._hashCode]; + // Mark as disposed this._disposed = true; }; - -/*! - Returns true if the object is disposed. -*/ -proto.getDisposed = function() { - return this._disposed; -}; - -/*! - Returns true if the object is disposed. -*/ -proto.isDisposed = function() { - return this._disposed; -}; |