TypeScript/tests/baselines/reference/indexClassByNumber.js
2014-08-15 15:49:09 -07: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