I have noticed that the registerClass function does not throw an error if the methods in the interfaces specified by the parameter interfaceTypes are not implemented in the class. Looking at the relevant section of the script code for the registerClass function we find:
if (interfaceTypes)
{
this.__interfaces = [];
this.resolveInheritance();
for (var i = 2, l = arguments.length; i < l; i++)
{
var interfaceType = arguments[i];
if (!interfaceType.__interface) throw Error.argument('interfaceTypes[' + (i - 2) + ']', Sys.Res.notAnInterface);
for (var methodName in interfaceType.prototype)
{
var method = interfaceType.prototype[methodName];
if (!this.prototype[methodName])
{
this.prototype[methodName] = method;
}
}
this.__interfaces.push(interfaceType);
}
}
Oddly, instead of throwing an error when an interface method is not implemented, it will copy the method in the prototype of the class ! Is there a reason for that ?
Pascal
http://csogateway.codeplex.com