Closed
Description
We compile this:
let foo = "bar";
let {[foo]: bar} = {bar: "bar"};
to this:
var foo = "bar";
var _a = [foo], bar;
{
bar: "bar";
}
;
(and error on the syntax)
whereas babel compiles it cleanly to this:
"use strict";
var foo = "bar";
var _bar = { bar: "bar" };
var bar = _bar[foo];
Babel's output functions as expected, ours does not.
There's a section on this on the MDN article on destructuring.