TypeScript/tests/baselines/reference/indexClassByNumber.js
2014-08-14 06:42:18 -07:00

19 lines
462 B
JavaScript

//// [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;