[Qooxdoo-commit] qooxdoo/source/script/core QxExtend.js,1.7.2.103,1.7.2.104
Brought to you by:
ecker,
martinwittemann
|
From: Sebastian W. <wp...@us...> - 2006-01-23 15:17:21
|
Update of /cvsroot/qooxdoo/qooxdoo/source/script/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8458/source/script/core Modified Files: Tag: renderer QxExtend.js Log Message: Enhanced type checks for property creation, fixed many outstanding bugs in this area, too Index: QxExtend.js =================================================================== RCS file: /cvsroot/qooxdoo/qooxdoo/source/script/core/QxExtend.js,v retrieving revision 1.7.2.103 retrieving revision 1.7.2.104 diff -u -d -r1.7.2.103 -r1.7.2.104 --- QxExtend.js 23 Jan 2006 14:50:42 -0000 1.7.2.103 +++ QxExtend.js 23 Jan 2006 15:17:13 -0000 1.7.2.104 @@ -343,10 +343,47 @@ if (QxUtil.isInvalidBoolean(p.allowMultipleArguments)) { p.allowMultipleArguments = false; }; + + + + + + + if (typeof p.type == QxConst.TYPEOF_STRING) { + p.hasType = true; + } + else if (typeof p.type != QxConst.TYPEOF_UNDEFINED) { + throw new Error("Invalid type definition for property " + p.name + ": " + p.type); + } + else { + p.hasType = false; + }; + + if (typeof p.instance == QxConst.TYPEOF_STRING) { + p.hasInstance = true; + } + else if (typeof p.instance != QxConst.TYPEOF_UNDEFINED) { + throw new Error("Invalid instance definition for property " + p.name + ": " + p.instance); + } + else { + p.hasInstance = false; + }; + + if (typeof p.classname == QxConst.TYPEOF_STRING) { + p.hasClassName = true; + } + else if (typeof p.classname != QxConst.TYPEOF_UNDEFINED) { + throw new Error("Invalid classname definition for property " + p.name + ": " + p.classname); + } + else { + p.hasClassName = false; + }; + + + + + - p.hasType = QxUtil.isValidString(p.type); - p.hasInstance = QxUtil.isValidString(p.instance); - p.hasClassName = QxUtil.isValidString(p.classname); p.hasConvert = QxUtil.isValidFunction(p.convert); p.hasPossibleValues = QxUtil.isValidArray(p.possibleValues); p.hasUnitDetection = QxUtil.isValidString(p.unitDetection); |