Destructured function arguments do not compile correctly
The following code
let fn = ({arg1 = 1}, {arg2 = 2}) => {
console.log(arg1, arg2);
}
Gets compiled as
var fn = function (ref, ref$1) {
var ref_arg1 = ref.arg1, arg1 = ref_arg1 === void 0 ? 1 : ref_arg1;
var ref$1_arg2 = ref.arg2, arg2 = ref_arg2 === void 0 ? 2 : ref_arg2;
console.log(arg1, arg2);
}
ref gets referenced for the second variable instead of ref$1.
Edit: as well as ref_arg2 instead of ref$1_arg2