(obj, path)
| 204 | } |
| 205 | |
| 206 | function registerClass(obj, path) { |
| 207 | var currentClassType, currentClassPath, collidingClassType, collidingClassPath, |
| 208 | |
| 209 | ClassConstructor = createClass(obj); |
| 210 | |
| 211 | treeIndexSet(ClassRegistry, path, ClassConstructor); |
| 212 | if (!ClassRegistry[getShortName(path)]) { |
| 213 | ClassRegistry[getShortName(path)] = ClassConstructor; |
| 214 | } else { |
| 215 | // we have a collision. Lets create a list of all the collisions and then later turn it into a warning for the user. |
| 216 | |
| 217 | currentClassType = (new ClassConstructor("NO_CONSTRUCT")).__t; |
| 218 | currentClassPath = tmpWrap(currentClassType); |
| 219 | |
| 220 | if (typeof ClassRegistry[getShortName(path)] === "function") { |
| 221 | collidingClassType = (new ClassRegistry[getShortName(path)]("NO_CONSTRUCT")).__t; |
| 222 | collidingClassPath = tmpWrap(collidingClassType); |
| 223 | |
| 224 | ClassRegistry[getShortName(path)] = [collidingClassPath, currentClassPath]; |
| 225 | } else { |
| 226 | // append to collision list |
| 227 | ClassRegistry[getShortName(path)].push(currentClassPath); |
| 228 | } |
| 229 | } |
| 230 | } |
| 231 | |
| 232 | function createClass(obj) { |
| 233 | var _c = {}; // the _c object is used to trick the function.name property to be correct for the class. |
no test coverage detected