diff --git a/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array-default-params/actual.js b/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array-default-params/actual.js new file mode 100644 index 0000000000..15f05d97e4 --- /dev/null +++ b/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array-default-params/actual.js @@ -0,0 +1 @@ +export const [foo, bar = 2] = []; diff --git a/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array-default-params/expected.js b/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array-default-params/expected.js new file mode 100644 index 0000000000..12d86476fb --- /dev/null +++ b/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array-default-params/expected.js @@ -0,0 +1,14 @@ +System.register([], function (_export, _context) { + "use strict"; + + return { + setters: [], + execute: function () { + const [foo, bar = 2] = []; + + _export("foo", foo); + + _export("bar", bar); + } + }; +}); \ No newline at end of file diff --git a/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array-rest/actual.js b/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array-rest/actual.js new file mode 100644 index 0000000000..0a9d393da8 --- /dev/null +++ b/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array-rest/actual.js @@ -0,0 +1 @@ +export const [foo, bar, ...baz] = []; diff --git a/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array-rest/expected.js b/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array-rest/expected.js new file mode 100644 index 0000000000..0d3b312a90 --- /dev/null +++ b/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array-rest/expected.js @@ -0,0 +1,16 @@ +System.register([], function (_export, _context) { + "use strict"; + + return { + setters: [], + execute: function () { + const [foo, bar, ...baz] = []; + + _export("foo", foo); + + _export("bar", bar); + + _export("baz", baz); + } + }; +}); \ No newline at end of file diff --git a/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array/actual.js b/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array/actual.js new file mode 100644 index 0000000000..17971b0e11 --- /dev/null +++ b/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array/actual.js @@ -0,0 +1 @@ +export const [foo, bar] = []; diff --git a/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array/expected.js b/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array/expected.js new file mode 100644 index 0000000000..056e92c9c2 --- /dev/null +++ b/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array/expected.js @@ -0,0 +1,14 @@ +System.register([], function (_export, _context) { + "use strict"; + + return { + setters: [], + execute: function () { + const [foo, bar] = []; + + _export("foo", foo); + + _export("bar", bar); + } + }; +}); \ No newline at end of file diff --git a/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-deep/actual.js b/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-deep/actual.js new file mode 100644 index 0000000000..7687ffa221 --- /dev/null +++ b/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-deep/actual.js @@ -0,0 +1 @@ +export const { foo: { bar: [baz, qux] } } = {}; diff --git a/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-deep/expected.js b/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-deep/expected.js new file mode 100644 index 0000000000..1a51fc3a4a --- /dev/null +++ b/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-deep/expected.js @@ -0,0 +1,18 @@ +System.register([], function (_export, _context) { + "use strict"; + + return { + setters: [], + execute: function () { + const { + foo: { + bar: [baz, qux] + } + } = {}; + + _export("baz", baz); + + _export("qux", qux); + } + }; +}); \ No newline at end of file diff --git a/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-default-params/actual.js b/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-default-params/actual.js new file mode 100644 index 0000000000..03958a0709 --- /dev/null +++ b/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-default-params/actual.js @@ -0,0 +1 @@ +export const { foo, bar = 1 } = {}; diff --git a/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-default-params/expected.js b/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-default-params/expected.js new file mode 100644 index 0000000000..487a8d1737 --- /dev/null +++ b/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-default-params/expected.js @@ -0,0 +1,17 @@ +System.register([], function (_export, _context) { + "use strict"; + + return { + setters: [], + execute: function () { + const { + foo, + bar = 1 + } = {}; + + _export("foo", foo); + + _export("bar", bar); + } + }; +}); \ No newline at end of file diff --git a/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-rest/actual.js b/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-rest/actual.js new file mode 100644 index 0000000000..d4d52568ce --- /dev/null +++ b/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-rest/actual.js @@ -0,0 +1 @@ +export const { foo, ...bar } = {}; diff --git a/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-rest/expected.js b/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-rest/expected.js new file mode 100644 index 0000000000..2d3075b744 --- /dev/null +++ b/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-rest/expected.js @@ -0,0 +1,17 @@ +System.register([], function (_export, _context) { + "use strict"; + + return { + setters: [], + execute: function () { + const { + foo, + ...bar + } = {}; + + _export("foo", foo); + + _export("bar", bar); + } + }; +}); \ No newline at end of file diff --git a/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-rest/options.json b/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-rest/options.json new file mode 100644 index 0000000000..9341ddf95d --- /dev/null +++ b/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-rest/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["external-helpers", "transform-es2015-modules-systemjs", "syntax-object-rest-spread"] +} diff --git a/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object/actual.js b/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object/actual.js new file mode 100644 index 0000000000..f571493604 --- /dev/null +++ b/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object/actual.js @@ -0,0 +1 @@ +export const { foo: bar, baz } = {}; diff --git a/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object/expected.js b/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object/expected.js new file mode 100644 index 0000000000..fdcd07d641 --- /dev/null +++ b/packages/babel-plugin-transform-es2015-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object/expected.js @@ -0,0 +1,17 @@ +System.register([], function (_export, _context) { + "use strict"; + + return { + setters: [], + execute: function () { + const { + foo: bar, + baz + } = {}; + + _export("bar", bar); + + _export("baz", baz); + } + }; +}); \ No newline at end of file