Josh Johnston 3cf4cee40a Fix 5768 (#5811)
* Fix destructured exports

- adds a failing test based on description in #5768
- handles ObjectPattern and ArrayPattern

* use export assignment template
2017-06-27 17:31:47 -04:00

28 lines
397 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.f1 = f1;
exports.f2 = f2;
exports.f3 = f3;
let x = exports.x = 0;
let y = exports.y = 0;
function f1() {
({ x } = { x: 1 });
exports.x = x;
}
function f2() {
({ x, y } = { x: 2, y: 3 });
exports.y = y;
exports.x = x;
}
function f3() {
[x, y, z] = [3, 4, 5];
exports.y = y;
exports.x = x;
}