From 8023788305011b8d355c7d0826ec7ee410b99fe5 Mon Sep 17 00:00:00 2001 From: guybedford Date: Wed, 21 Jan 2015 13:58:49 +0200 Subject: [PATCH] add generator and variable binding tests --- .../exports-generator/actual.js | 3 +++ .../exports-generator/expected.js | 23 +++++++++++++++++++ .../exports-variable/actual.js | 1 + .../exports-variable/expected.js | 2 ++ 4 files changed, 29 insertions(+) create mode 100644 test/fixtures/transformation/es6-modules-system/exports-generator/actual.js create mode 100644 test/fixtures/transformation/es6-modules-system/exports-generator/expected.js diff --git a/test/fixtures/transformation/es6-modules-system/exports-generator/actual.js b/test/fixtures/transformation/es6-modules-system/exports-generator/actual.js new file mode 100644 index 0000000000..18cc16452e --- /dev/null +++ b/test/fixtures/transformation/es6-modules-system/exports-generator/actual.js @@ -0,0 +1,3 @@ +export function* generator() { + yield 1; +} \ No newline at end of file diff --git a/test/fixtures/transformation/es6-modules-system/exports-generator/expected.js b/test/fixtures/transformation/es6-modules-system/exports-generator/expected.js new file mode 100644 index 0000000000..c29c847f06 --- /dev/null +++ b/test/fixtures/transformation/es6-modules-system/exports-generator/expected.js @@ -0,0 +1,23 @@ +System.register([], function (_export) { + "use strict"; + + var generator; + _export("generator", generator = regeneratorRuntime.mark(function generator() { + return regeneratorRuntime.wrap(function generator$(context$1$0) { + while (1) switch (context$1$0.prev = context$1$0.next) { + case 0: + context$1$0.next = 2; + return 1; + case 2: + case "end": + return context$1$0.stop(); + } + }, generator, this); + })); + + return { + setters: [], + execute: function () { + } + }; +}); diff --git a/test/fixtures/transformation/es6-modules-system/exports-variable/actual.js b/test/fixtures/transformation/es6-modules-system/exports-variable/actual.js index b4629cc731..4dca36e134 100644 --- a/test/fixtures/transformation/es6-modules-system/exports-variable/actual.js +++ b/test/fixtures/transformation/es6-modules-system/exports-variable/actual.js @@ -6,3 +6,4 @@ export let foo5; export const foo6 = 3; export function foo7 () {} export class foo8 {} +foo3 = 5; diff --git a/test/fixtures/transformation/es6-modules-system/exports-variable/expected.js b/test/fixtures/transformation/es6-modules-system/exports-variable/expected.js index 9c643cfdb6..c82bf127e9 100644 --- a/test/fixtures/transformation/es6-modules-system/exports-variable/expected.js +++ b/test/fixtures/transformation/es6-modules-system/exports-variable/expected.js @@ -17,6 +17,8 @@ System.register([], function (_export) { foo8 = function foo8() {}; _export("foo8", foo8); + + _export("foo3", foo3 = 5); } }; }); \ No newline at end of file