[Qooxdoo-commit] qooxdoo/source/script/core QxExtend.js,1.7.2.105,1.7.2.106
Brought to you by:
ecker,
martinwittemann
|
From: Sebastian W. <wp...@us...> - 2006-01-23 16:02:18
|
Update of /cvsroot/qooxdoo/qooxdoo/source/script/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26303/source/script/core Modified Files: Tag: renderer QxExtend.js Log Message: Minor improvements Index: QxExtend.js =================================================================== RCS file: /cvsroot/qooxdoo/qooxdoo/source/script/core/QxExtend.js,v retrieving revision 1.7.2.105 retrieving revision 1.7.2.106 diff -u -d -r1.7.2.105 -r1.7.2.106 --- QxExtend.js 23 Jan 2006 15:26:26 -0000 1.7.2.105 +++ QxExtend.js 23 Jan 2006 16:01:52 -0000 1.7.2.106 @@ -478,11 +478,11 @@ var oldValue = this[valueKey]; - if (newValue == oldValue) { + if (newValue === oldValue) { return newValue; }; - if (!(newValue == null && p.allowNull)) + if (!(p.allowNull && newValue == null)) { if (p.hasType && typeof newValue != p.type) { return this.error("Attention! The value \"" + newValue + "\" is an invalid value for the property \"" + p.name + "\" which must be typeof \"" + p.type + "\" but is typeof \"" + typeof newValue + "\"!", QxConst.INTERNAL_SET + p.method); @@ -502,14 +502,14 @@ }; // Allow to check and transform the new value before storage - if (typeof this[checkKey] == QxConst.TYPEOF_FUNCTION) + if (typeof this[checkKey] === QxConst.TYPEOF_FUNCTION) { try { newValue = this[checkKey](newValue, p); // Don't do anything if new value is indentical to old value - if (newValue == oldValue) { + if (newValue === oldValue) { return newValue; }; } @@ -523,7 +523,7 @@ this[valueKey] = newValue; // Check if there is a modifier implementation - if (typeof this[modifyKey] == QxConst.TYPEOF_FUNCTION) + if (typeof this[modifyKey] === QxConst.TYPEOF_FUNCTION) { try { @@ -559,20 +559,18 @@ // Create Event if (this.hasEventListeners && this.hasEventListeners(changeKey)) { - var ce = new QxDataEvent(changeKey, newValue, oldValue, false); + var vEvent = new QxDataEvent(changeKey, newValue, oldValue, false); - ce.setTarget(this); + vEvent.setTarget(this); try { - this.dispatchEvent(ce, true); + this.dispatchEvent(vEvent, true); } catch(ex) { throw new Error("Property " + p.name + " modified: Failed to dispatch change event: " + ex); }; - - ce = null; }; return newValue; @@ -587,11 +585,11 @@ var oldValue = this[valueKey]; - if (newValue == oldValue) { + if (newValue === oldValue) { return newValue; }; - if (!(newValue == null && p.allowNull)) + if (!(p.allowNull && newValue == null)) { if (p.hasType && typeof newValue != p.type) { return this.error("Attention! The value \"" + newValue + "\" is an invalid value for the property \"" + p.name + "\" which must be typeof \"" + p.type + "\" but is typeof \"" + typeof newValue + "\"!", QxConst.INTERNAL_SET + p.method); @@ -599,14 +597,14 @@ }; // Allow to check and transform the new value before storage - if (typeof this[checkKey] == QxConst.TYPEOF_FUNCTION) + if (typeof this[checkKey] === QxConst.TYPEOF_FUNCTION) { try { newValue = this[checkKey](newValue, p); // Don't do anything if new value is indentical to old value - if (newValue == oldValue) { + if (newValue === oldValue) { return newValue; }; } @@ -620,7 +618,7 @@ this[valueKey] = newValue; // Check if there is a modifier implementation - if (typeof this[modifyKey] == QxConst.TYPEOF_FUNCTION) + if (typeof this[modifyKey] === QxConst.TYPEOF_FUNCTION) { try { @@ -638,20 +636,18 @@ // Create Event if (this.hasEventListeners && this.hasEventListeners(changeKey)) { - var ce = new QxDataEvent(changeKey, newValue, oldValue, false); + var vEvent = new QxDataEvent(changeKey, newValue, oldValue, false); - ce.setTarget(this); + vEvent.setTarget(this); try { - this.dispatchEvent(ce, true); + this.dispatchEvent(vEvent, true); } catch(ex) { throw new Error("Property " + p.name + " modified: Failed to dispatch change event: " + ex); }; - - ce = null; }; return newValue; |