TypeScript/tests/baselines/reference/indexClassByNumber.js

19 lines
486 B
TypeScript
Raw Normal View History

2014-07-13 01:04:16 +02:00
//// [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)
2014-07-13 01:04:16 +02:00
var foo = (function () {
function foo() {
}
return foo;
})();
var f = new foo();
f[0] = 4; // Shouldn't be allowed