TypeScript/tests/baselines/reference/collisionRestParameterUnderscoreIUsage.js

24 lines
645 B
TypeScript
Raw Normal View History

2014-07-13 01:04:16 +02:00
//// [collisionRestParameterUnderscoreIUsage.ts]
declare var console: { log(msg?: string): void; };
var _i = "This is what I'd expect to see";
class Foo {
constructor(...args: any[]) {
console.log(_i); // This should result in error
}
}
new Foo();
//// [collisionRestParameterUnderscoreIUsage.js]
var _i = "This is what I'd expect to see";
var Foo = (function () {
function Foo() {
2014-07-13 01:04:16 +02:00
var args = [];
for (var _a = 0; _a < arguments.length; _a++) {
args[_a - 0] = arguments[_a];
2014-07-13 01:04:16 +02:00
}
console.log(_i); // This should result in error
2014-07-13 01:04:16 +02:00
}
return Foo;
})();
new Foo();