1 Type.prototype.registerInterface = function Type$registerInterface(typeName) {
5 var e = Function._validateParams(arguments, [
6 {name: "typeName", type: String}
7 ]);
8 if (e) throw e;
9 if (!Type.__fullyQualifiedIdentifierRegExp.test(typeName)) throw Error.argument('typeName', Sys.Res.notATypeName);
10 var parsedName;
11 try {
12 parsedName = eval(typeName);
13 }
14 catch(e) {
15 throw Error.argument('typeName', Sys.Res.argumentTypeName);
16 }
17 if (parsedName !== this) throw Error.argument('typeName', Sys.Res.badTypeName);
18 if (Sys.__registeredTypes[typeName]) throw Error.invalidOperation(String.format(Sys.Res.typeRegisteredTwice, typeName));
19 Sys.__upperCaseTypes[typeName.toUpperCase()] = this;
20 this.prototype.constructor = this;
21 this.__typeName = typeName;
22 this.__interface = true;
23 Sys.__registeredTypes[typeName] = true;
24 return this;
25 }