TypeScript/tests/baselines/reference/argumentsAsPropertyName2.js
Eli Barzilay f447838f95 Fix handling of aruments in the emitter
Two problems are fixed:

* `isArgumentsLocalBinding` did only `PropertyAccessExpression`, now
  it's also doing `PropertyAssignment` (doesn't affect other files,
  since it's only used in the emitter).

* `visitShorthandPropertyAssignment` should call `visitIdentifier` on
  the synthesized id.  (For completion it might be better to make it
  visit the the original?)

Fixes #38594.
2020-06-13 07:05:21 -04:00

30 lines
643 B
TypeScript

//// [argumentsAsPropertyName2.ts]
// target: es5
function foo() {
for (let x = 0; x < 1; ++x) {
let i : number;
[].forEach(function () { i });
({ arguments: 0 });
({ arguments });
({ arguments: arguments });
}
}
//// [argumentsAsPropertyName2.js]
// target: es5
function foo() {
var _loop_1 = function (x) {
var i;
[].forEach(function () { i; });
({ arguments: 0 });
({ arguments: arguments_1 });
({ arguments: arguments_1 });
};
var arguments_1 = arguments;
for (var x = 0; x < 1; ++x) {
_loop_1(x);
}
}