diff --git a/test/fixtures/transformation/api/blacklist/expected.js b/test/fixtures/transformation/api/blacklist/expected.js index 5c7dbf6a7d..01fd9509ac 100644 --- a/test/fixtures/transformation/api/blacklist/expected.js +++ b/test/fixtures/transformation/api/blacklist/expected.js @@ -1,9 +1,5 @@ "use strict"; -var Test = function() { - var Test = function Test() { - arr.map(x => x * x); - }; - - return Test; -}(); \ No newline at end of file +var Test = function Test() { + arr.map(x => x * x); +}; diff --git a/test/fixtures/transformation/classes/constructor/expected.js b/test/fixtures/transformation/classes/constructor/expected.js index 57865f997b..fcf8fb6aae 100644 --- a/test/fixtures/transformation/classes/constructor/expected.js +++ b/test/fixtures/transformation/classes/constructor/expected.js @@ -13,13 +13,9 @@ var _extends = function (child, parent) { child.__proto__ = parent; }; -var Test = function() { - var Test = function Test() { - this.state = "test"; - }; - - return Test; -}(); +var Test = function Test() { + this.state = "test"; +}; var Foo = function(Bar) { var Foo = function Foo() { diff --git a/test/fixtures/transformation/classes/plain-class/expected.js b/test/fixtures/transformation/classes/plain-class/expected.js index 8a01ecc89b..5f98760f68 100644 --- a/test/fixtures/transformation/classes/plain-class/expected.js +++ b/test/fixtures/transformation/classes/plain-class/expected.js @@ -1,6 +1,3 @@ "use strict"; -var Test = function() { - var Test = function Test() {}; - return Test; -}(); \ No newline at end of file +var Test = function Test() {}; diff --git a/test/fixtures/transformation/classes/statement/actual.js b/test/fixtures/transformation/classes/statement/actual.js index 9c91c07071..bef8f5ecd1 100644 --- a/test/fixtures/transformation/classes/statement/actual.js +++ b/test/fixtures/transformation/classes/statement/actual.js @@ -1,11 +1,17 @@ var BaseView = class BaseView { constructor() { - this.autoRender = true; + this.autoRender = true; } } var BaseView = class { constructor() { - this.autoRender = true; + this.autoRender = true; + } +} + +var BaseView = class { + foo() { + this.autoRender = true; } } diff --git a/test/fixtures/transformation/classes/statement/expected.js b/test/fixtures/transformation/classes/statement/expected.js index d0927c7d9c..251f0329d7 100644 --- a/test/fixtures/transformation/classes/statement/expected.js +++ b/test/fixtures/transformation/classes/statement/expected.js @@ -1,17 +1,25 @@ "use strict"; -var BaseView = function() { - var BaseView = function BaseView() { - this.autoRender = true; - }; +var BaseView = function BaseView() { + this.autoRender = true; +}; - return BaseView; +var BaseView = function() { + this.autoRender = true; +}; + + +var BaseView = function() { + var _class2 = function() {}; + + Object.defineProperties(_class2.prototype, { + foo: { + writable: true, + value: function() { + this.autoRender = true; + } + } + }); + + return _class2; }(); - -var BaseView = function() { - var _class = function() { - this.autoRender = true; - }; - - return _class; -}(); \ No newline at end of file diff --git a/test/fixtures/transformation/classes/super-function-fallback/actual.js b/test/fixtures/transformation/classes/super-function-fallback/actual.js index a91635eec0..18ebeb8f30 100644 --- a/test/fixtures/transformation/classes/super-function-fallback/actual.js +++ b/test/fixtures/transformation/classes/super-function-fallback/actual.js @@ -1,5 +1,5 @@ class Test { constructor() { - super.hasOwnProperty("test"); + super.hasOwnProperty("test"); } } diff --git a/test/fixtures/transformation/classes/super-function-fallback/expected.js b/test/fixtures/transformation/classes/super-function-fallback/expected.js index fd52698532..e17e74db06 100644 --- a/test/fixtures/transformation/classes/super-function-fallback/expected.js +++ b/test/fixtures/transformation/classes/super-function-fallback/expected.js @@ -1,9 +1,5 @@ "use strict"; -var Test = function() { - var Test = function Test() { - Function.prototype.hasOwnProperty.call(this, "test"); - }; - - return Test; -}(); \ No newline at end of file +var Test = function Test() { + Function.prototype.hasOwnProperty.call(this, "test"); +}; diff --git a/test/fixtures/transformation/comments/preserve-multi-line/expected.js b/test/fixtures/transformation/comments/preserve-multi-line/expected.js index af07f9cc9b..1af4bf8949 100644 --- a/test/fixtures/transformation/comments/preserve-multi-line/expected.js +++ b/test/fixtures/transformation/comments/preserve-multi-line/expected.js @@ -1,3 +1,6 @@ "use strict"; wow; -test.wow(); \ No newline at end of file +/* + um yeah lol +*/ +test.wow(); diff --git a/test/fixtures/transformation/comments/preserve-single-line/expected.js b/test/fixtures/transformation/comments/preserve-single-line/expected.js index af07f9cc9b..5ae1bb997c 100644 --- a/test/fixtures/transformation/comments/preserve-single-line/expected.js +++ b/test/fixtures/transformation/comments/preserve-single-line/expected.js @@ -1,3 +1,4 @@ "use strict"; wow; -test.wow(); \ No newline at end of file +// um yeah lol +test.wow(); diff --git a/test/fixtures/transformation/jsx/annotation/expected.js b/test/fixtures/transformation/jsx/annotation/expected.js index cd478b7097..2069c82ded 100644 --- a/test/fixtures/transformation/jsx/annotation/expected.js +++ b/test/fixtures/transformation/jsx/annotation/expected.js @@ -1,2 +1,5 @@ +/** @jsx CUSTOM_DOM */ + "use strict"; -CUSTOM_DOM.a(null); \ No newline at end of file + +CUSTOM_DOM.a(null); diff --git a/test/fixtures/transformation/let-scoping/in-properties/exec.js b/test/fixtures/transformation/let-scoping/in-properties/exec.js index 610f53a989..9cba2236c1 100644 --- a/test/fixtures/transformation/let-scoping/in-properties/exec.js +++ b/test/fixtures/transformation/let-scoping/in-properties/exec.js @@ -1,15 +1,15 @@ var object = { get x() { - while (true) { - let let_x = 'let x'; - return let_x; - } + while (true) { + let let_x = 'let x'; + return let_x; + } }, set x(v) { - do { - let let_v = v; - this.v = let_v; - } while (false); + do { + let let_v = v; + this.v = let_v; + } while (false); } -} +}; diff --git a/test/fixtures/transformation/modules-amd/exports-default/expected.js b/test/fixtures/transformation/modules-amd/exports-default/expected.js index 06520d1ad3..57ec077324 100644 --- a/test/fixtures/transformation/modules-amd/exports-default/expected.js +++ b/test/fixtures/transformation/modules-amd/exports-default/expected.js @@ -7,15 +7,9 @@ define(["exports"], function (exports) { exports.default = foo; exports.default = function() {}; - exports.default = function() { - var _class = function() {}; - return _class; - }(); + exports.default = function() {}; exports.default = function foo() {}; - exports.default = function() { - var foo = function foo() {}; - return foo; - }(); + exports.default = function foo() {}; }); diff --git a/test/fixtures/transformation/modules-amd/exports-variable/expected.js b/test/fixtures/transformation/modules-amd/exports-variable/expected.js index 699776217c..b985e7bb94 100644 --- a/test/fixtures/transformation/modules-amd/exports-variable/expected.js +++ b/test/fixtures/transformation/modules-amd/exports-variable/expected.js @@ -16,10 +16,7 @@ define(["exports"], function (exports) { exports.foo6 = _foo6; function foo7() {} - var foo8 = function() { - var foo8 = function foo8() {}; - return foo8; - }(); + var foo8 = function foo8() {}; exports.foo8 = foo8; }); diff --git a/test/fixtures/transformation/modules-common/exports-default/expected.js b/test/fixtures/transformation/modules-common/exports-default/expected.js index 3af8e0aa7d..a3a7f93464 100644 --- a/test/fixtures/transformation/modules-common/exports-default/expected.js +++ b/test/fixtures/transformation/modules-common/exports-default/expected.js @@ -5,14 +5,8 @@ exports.default = []; exports.default = foo; exports.default = function() {}; -exports.default = function() { - var _class = function() {}; - return _class; -}(); +exports.default = function() {}; exports.default = function foo() {}; -exports.default = function() { - var foo = function foo() {}; - return foo; -}(); \ No newline at end of file +exports.default = function foo() {}; diff --git a/test/fixtures/transformation/modules-common/exports-variable/expected.js b/test/fixtures/transformation/modules-common/exports-variable/expected.js index 6c696495cd..e46d8ef9ef 100644 --- a/test/fixtures/transformation/modules-common/exports-variable/expected.js +++ b/test/fixtures/transformation/modules-common/exports-variable/expected.js @@ -14,9 +14,6 @@ var _foo6 = 3; exports.foo6 = _foo6; function foo7() {} -var foo8 = function() { - var foo8 = function foo8() {}; - return foo8; -}(); +var foo8 = function foo8() {}; -exports.foo8 = foo8; \ No newline at end of file +exports.foo8 = foo8; diff --git a/test/fixtures/transformation/modules-umd/exports-default/expected.js b/test/fixtures/transformation/modules-umd/exports-default/expected.js index a57b014819..4de9ddd916 100644 --- a/test/fixtures/transformation/modules-umd/exports-default/expected.js +++ b/test/fixtures/transformation/modules-umd/exports-default/expected.js @@ -13,15 +13,9 @@ exports.default = foo; exports.default = function() {}; - exports.default = function() { - var _class = function() {}; - return _class; - }(); + exports.default = function() {}; exports.default = function foo() {}; - exports.default = function() { - var foo = function foo() {}; - return foo; - }(); + exports.default = function foo() {}; }); diff --git a/test/fixtures/transformation/modules-umd/exports-variable/expected.js b/test/fixtures/transformation/modules-umd/exports-variable/expected.js index aeb48672d5..830192694b 100644 --- a/test/fixtures/transformation/modules-umd/exports-variable/expected.js +++ b/test/fixtures/transformation/modules-umd/exports-variable/expected.js @@ -22,10 +22,7 @@ exports.foo6 = _foo6; function foo7() {} - var foo8 = function() { - var foo8 = function foo8() {}; - return foo8; - }(); + var foo8 = function foo8() {}; exports.foo8 = foo8; }); diff --git a/test/fixtures/transformation/source-maps/arrow-function/expected.js b/test/fixtures/transformation/source-maps/arrow-function/expected.js index 57c86edadf..bdec8047ef 100644 --- a/test/fixtures/transformation/source-maps/arrow-function/expected.js +++ b/test/fixtures/transformation/source-maps/arrow-function/expected.js @@ -2,4 +2,4 @@ var t = function(x) { return x * x; -}; \ No newline at end of file +};