TypeScript/tests/baselines/reference/indexClassByNumber.js
2015-12-08 17:51:10 -08:00

19 lines
486 B
TypeScript

//// [indexClassByNumber.ts]
// Shouldn't be able to index a class instance by a number (unless it has declared a number index signature)
class foo { }
var f = new foo();
f[0] = 4; // Shouldn't be allowed
//// [indexClassByNumber.js]
// Shouldn't be able to index a class instance by a number (unless it has declared a number index signature)
var foo = (function () {
function foo() {
}
return foo;
}());
var f = new foo();
f[0] = 4; // Shouldn't be allowed