diff --git a/test/core/fixtures/transformation/.es7-decorators/class/actual.js b/test/core/fixtures/transformation/.es7-decorators/class/actual.js deleted file mode 100644 index f8856dc3dc..0000000000 --- a/test/core/fixtures/transformation/.es7-decorators/class/actual.js +++ /dev/null @@ -1,6 +0,0 @@ -@foo -class Foo {} - -@foo -@bar -class Bar {} diff --git a/test/core/fixtures/transformation/.es7-decorators/options.json b/test/core/fixtures/transformation/.es7-decorators/options.json deleted file mode 100644 index 1e9fd6e0c2..0000000000 --- a/test/core/fixtures/transformation/.es7-decorators/options.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "externalHelpers": true, - "optional": ["es7.decorators"] -} diff --git a/test/core/fixtures/transformation/es7-decorators/class-getter-and-setter/actual.js b/test/core/fixtures/transformation/es7-decorators/class-getter-and-setter/actual.js new file mode 100644 index 0000000000..b0262c5699 --- /dev/null +++ b/test/core/fixtures/transformation/es7-decorators/class-getter-and-setter/actual.js @@ -0,0 +1,11 @@ +class Foo { + @bar + get foo() { + + } + + @foo + set foo(bar) { + + } +} diff --git a/test/core/fixtures/transformation/es7-decorators/class-getter-and-setter/expected.js b/test/core/fixtures/transformation/es7-decorators/class-getter-and-setter/expected.js new file mode 100644 index 0000000000..73f0d1d146 --- /dev/null +++ b/test/core/fixtures/transformation/es7-decorators/class-getter-and-setter/expected.js @@ -0,0 +1,15 @@ +"use strict"; + +var Foo = (function () { + function Foo() { + babelHelpers.classCallCheck(this, Foo); + } + + babelHelpers.createDecoratedClass(Foo, [{ + key: "foo", + decorators: [bar, foo], + get: function () {}, + set: function (bar) {} + }]); + return Foo; +})(); \ No newline at end of file diff --git a/test/core/fixtures/transformation/es7-decorators/class-getter/actual.js b/test/core/fixtures/transformation/es7-decorators/class-getter/actual.js new file mode 100644 index 0000000000..c09d8bfaf2 --- /dev/null +++ b/test/core/fixtures/transformation/es7-decorators/class-getter/actual.js @@ -0,0 +1,6 @@ +class Foo { + @bar + get foo() { + + } +} diff --git a/test/core/fixtures/transformation/es7-decorators/class-getter/expected.js b/test/core/fixtures/transformation/es7-decorators/class-getter/expected.js new file mode 100644 index 0000000000..3beba2e582 --- /dev/null +++ b/test/core/fixtures/transformation/es7-decorators/class-getter/expected.js @@ -0,0 +1,14 @@ +"use strict"; + +var Foo = (function () { + function Foo() { + babelHelpers.classCallCheck(this, Foo); + } + + babelHelpers.createDecoratedClass(Foo, [{ + key: "foo", + decorators: [bar], + get: function () {} + }]); + return Foo; +})(); \ No newline at end of file diff --git a/test/core/fixtures/transformation/es7-decorators/class-init-instance-props/actual.js b/test/core/fixtures/transformation/es7-decorators/class-init-instance-props/actual.js new file mode 100644 index 0000000000..24d63020fd --- /dev/null +++ b/test/core/fixtures/transformation/es7-decorators/class-init-instance-props/actual.js @@ -0,0 +1,4 @@ +class Foo { + @bar + foo = "Bar"; +} diff --git a/test/core/fixtures/transformation/es7-decorators/class-init-instance-props/expected.js b/test/core/fixtures/transformation/es7-decorators/class-init-instance-props/expected.js new file mode 100644 index 0000000000..a9f20009d2 --- /dev/null +++ b/test/core/fixtures/transformation/es7-decorators/class-init-instance-props/expected.js @@ -0,0 +1,20 @@ +"use strict"; + +var Foo = (function () { + var _instanceInitializers = {}; + + function Foo() { + babelHelpers.classCallCheck(this, Foo); + this.foo = _instanceInitializers.foo.call(this); + } + + babelHelpers.createDecoratedClass(Foo, [{ + key: "foo", + enumerable: true, + decorators: [bar], + initializer: function () { + return "Bar"; + } + }], null, _instanceInitializers); + return Foo; +})(); \ No newline at end of file diff --git a/test/core/fixtures/transformation/es7-decorators/class-init-static-props/actual.js b/test/core/fixtures/transformation/es7-decorators/class-init-static-props/actual.js new file mode 100644 index 0000000000..50ba1a8f7d --- /dev/null +++ b/test/core/fixtures/transformation/es7-decorators/class-init-static-props/actual.js @@ -0,0 +1,4 @@ +class Foo { + @bar + static foo = "Bar"; +} diff --git a/test/core/fixtures/transformation/es7-decorators/class-init-static-props/expected.js b/test/core/fixtures/transformation/es7-decorators/class-init-static-props/expected.js new file mode 100644 index 0000000000..fef3cd04e4 --- /dev/null +++ b/test/core/fixtures/transformation/es7-decorators/class-init-static-props/expected.js @@ -0,0 +1,20 @@ +"use strict"; + +var Foo = (function () { + var _staticInitializers = {}; + + function Foo() { + babelHelpers.classCallCheck(this, Foo); + } + + babelHelpers.createDecoratedClass(Foo, null, [{ + key: "foo", + enumerable: true, + decorators: [bar], + initializer: function () { + return "Bar"; + } + }], null, _staticInitializers); + Foo.foo = _staticInitializers.foo.call(Foo); + return Foo; +})(); \ No newline at end of file diff --git a/test/core/fixtures/transformation/es7-decorators/class-method/actual.js b/test/core/fixtures/transformation/es7-decorators/class-method/actual.js new file mode 100644 index 0000000000..b2f8e63381 --- /dev/null +++ b/test/core/fixtures/transformation/es7-decorators/class-method/actual.js @@ -0,0 +1,6 @@ +class Foo { + @bar + foo() { + + } +} diff --git a/test/core/fixtures/transformation/es7-decorators/class-method/expected.js b/test/core/fixtures/transformation/es7-decorators/class-method/expected.js new file mode 100644 index 0000000000..2ad2f8b0aa --- /dev/null +++ b/test/core/fixtures/transformation/es7-decorators/class-method/expected.js @@ -0,0 +1,14 @@ +"use strict"; + +var Foo = (function () { + function Foo() { + babelHelpers.classCallCheck(this, Foo); + } + + babelHelpers.createDecoratedClass(Foo, [{ + key: "foo", + decorators: [bar], + value: function foo() {} + }]); + return Foo; +})(); \ No newline at end of file diff --git a/test/core/fixtures/transformation/es7-decorators/class-no-init-instance-props/actual.js b/test/core/fixtures/transformation/es7-decorators/class-no-init-instance-props/actual.js new file mode 100644 index 0000000000..c739a74257 --- /dev/null +++ b/test/core/fixtures/transformation/es7-decorators/class-no-init-instance-props/actual.js @@ -0,0 +1,4 @@ +class Foo { + @bar + foo; +} diff --git a/test/core/fixtures/transformation/es7-decorators/class-no-init-instance-props/expected.js b/test/core/fixtures/transformation/es7-decorators/class-no-init-instance-props/expected.js new file mode 100644 index 0000000000..94d9c195e3 --- /dev/null +++ b/test/core/fixtures/transformation/es7-decorators/class-no-init-instance-props/expected.js @@ -0,0 +1,18 @@ +"use strict"; + +var Foo = (function () { + var _instanceInitializers = {}; + + function Foo() { + babelHelpers.classCallCheck(this, Foo); + this.foo = _instanceInitializers.foo.call(this); + } + + babelHelpers.createDecoratedClass(Foo, [{ + key: "foo", + enumerable: true, + decorators: [bar], + initializer: function () {} + }], null, _instanceInitializers); + return Foo; +})(); \ No newline at end of file diff --git a/test/core/fixtures/transformation/es7-decorators/class-no-init-static-props/actual.js b/test/core/fixtures/transformation/es7-decorators/class-no-init-static-props/actual.js new file mode 100644 index 0000000000..45fe716ac4 --- /dev/null +++ b/test/core/fixtures/transformation/es7-decorators/class-no-init-static-props/actual.js @@ -0,0 +1,4 @@ +class Foo { + @bar + static foo; +} diff --git a/test/core/fixtures/transformation/es7-decorators/class-no-init-static-props/expected.js b/test/core/fixtures/transformation/es7-decorators/class-no-init-static-props/expected.js new file mode 100644 index 0000000000..5ac983268b --- /dev/null +++ b/test/core/fixtures/transformation/es7-decorators/class-no-init-static-props/expected.js @@ -0,0 +1,18 @@ +"use strict"; + +var Foo = (function () { + var _staticInitializers = {}; + + function Foo() { + babelHelpers.classCallCheck(this, Foo); + } + + babelHelpers.createDecoratedClass(Foo, null, [{ + key: "foo", + enumerable: true, + decorators: [bar], + initializer: function () {} + }], null, _staticInitializers); + Foo.foo = _staticInitializers.foo.call(Foo); + return Foo; +})(); \ No newline at end of file diff --git a/test/core/fixtures/transformation/es7-decorators/class-setter/actual.js b/test/core/fixtures/transformation/es7-decorators/class-setter/actual.js new file mode 100644 index 0000000000..db86413764 --- /dev/null +++ b/test/core/fixtures/transformation/es7-decorators/class-setter/actual.js @@ -0,0 +1,6 @@ +class Foo { + @bar + set foo(arg) { + + } +} diff --git a/test/core/fixtures/transformation/es7-decorators/class-setter/expected.js b/test/core/fixtures/transformation/es7-decorators/class-setter/expected.js new file mode 100644 index 0000000000..ece61ab6e1 --- /dev/null +++ b/test/core/fixtures/transformation/es7-decorators/class-setter/expected.js @@ -0,0 +1,14 @@ +"use strict"; + +var Foo = (function () { + function Foo() { + babelHelpers.classCallCheck(this, Foo); + } + + babelHelpers.createDecoratedClass(Foo, [{ + key: "foo", + decorators: [bar], + set: function (arg) {} + }]); + return Foo; +})(); \ No newline at end of file diff --git a/test/core/fixtures/transformation/es7-decorators/class/actual.js b/test/core/fixtures/transformation/es7-decorators/class/actual.js new file mode 100644 index 0000000000..d7af40351a --- /dev/null +++ b/test/core/fixtures/transformation/es7-decorators/class/actual.js @@ -0,0 +1,14 @@ +@foo +class Foo {} + +@foo +@bar +class Bar {} + +var Foo2 = @bar class Foo { + +}; + +var Bar2 = @foo @bar class Bar { + +}; diff --git a/test/core/fixtures/transformation/.es7-decorators/class/expected.js b/test/core/fixtures/transformation/es7-decorators/class/expected.js similarity index 51% rename from test/core/fixtures/transformation/.es7-decorators/class/expected.js rename to test/core/fixtures/transformation/es7-decorators/class/expected.js index 08fe7b6438..cb9c85c166 100644 --- a/test/core/fixtures/transformation/.es7-decorators/class/expected.js +++ b/test/core/fixtures/transformation/es7-decorators/class/expected.js @@ -18,3 +18,22 @@ var Bar = (function () { Bar = bar(Bar) || Bar; return Bar; })(); + +var Foo2 = (function () { + function Foo() { + babelHelpers.classCallCheck(this, Foo); + } + + Foo = bar(Foo) || Foo; + return Foo; +})(); + +var Bar2 = (function () { + function Bar() { + babelHelpers.classCallCheck(this, Bar); + } + + Bar = foo(Bar) || Bar; + Bar = bar(Bar) || Bar; + return Bar; +})(); \ No newline at end of file diff --git a/test/core/fixtures/transformation/.es7-decorators/exec-class-method-autobind/exec.js b/test/core/fixtures/transformation/es7-decorators/exec-class-method-autobind/exec.js similarity index 100% rename from test/core/fixtures/transformation/.es7-decorators/exec-class-method-autobind/exec.js rename to test/core/fixtures/transformation/es7-decorators/exec-class-method-autobind/exec.js diff --git a/test/core/fixtures/transformation/es7-decorators/options.json b/test/core/fixtures/transformation/es7-decorators/options.json new file mode 100644 index 0000000000..0806d65527 --- /dev/null +++ b/test/core/fixtures/transformation/es7-decorators/options.json @@ -0,0 +1,4 @@ +{ + "externalHelpers": true, + "optional": ["es7.decorators", "es7.classProperties"] +}