Closed
Description
Code
class C {
foo(arg1, arg2) {
[arg1, arg2] = [arg2, arg1];
return arg1;
}
}
Expected behavior:
I would expect any temporary variable declaration to be inserted before use (in this case _a).
I would certainly not expect it after a return statement , giving unreachable code.
Actual behavior:
var C = (function () {
function C() {
}
C.prototype.foo = function (arg1, arg2) {
_a = [arg2, arg1], arg1 = _a[0], arg2 = _a[1];
return arg1;
var _a;
};
return C;
}());