2014-07-13 01:04:16 +02:00
|
|
|
//// [typedGenericPrototypeMember.ts]
|
|
|
|
class List<T> {
|
|
|
|
add(item: T) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
List.prototype.add("abc"); // Valid because T is instantiated to any
|
|
|
|
|
|
|
|
|
|
|
|
//// [typedGenericPrototypeMember.js]
|
|
|
|
var List = (function () {
|
|
|
|
function List() {
|
|
|
|
}
|
2015-02-07 03:45:09 +01:00
|
|
|
List.prototype.add = function (item) { };
|
2014-07-13 01:04:16 +02:00
|
|
|
return List;
|
|
|
|
})();
|
2014-08-16 00:49:09 +02:00
|
|
|
List.prototype.add("abc"); // Valid because T is instantiated to any
|