From 171bcad870d4bbac5364ad03239bc380b69c6179 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 3 Nov 2014 17:52:15 +1100 Subject: [PATCH] make transformation tests compare output instead of ast --- lib/6to5/generator.js | 9 +++- .../transformation/api/blacklist/expected.js | 2 +- .../transformation/api/whitelist/expected.js | 6 +-- .../array-comprehension/arguments/expected.js | 3 +- .../multiple-if/expected.js | 9 ++-- .../array-comprehension/multiple/expected.js | 9 ++-- .../array-comprehension/single-if/expected.js | 4 +- .../array-comprehension/single/expected.js | 2 +- .../array-comprehension/this/expected.js | 7 +-- .../arrow-functions/arguments/expected.js | 43 ++++----------- .../default-parameters/expected.js | 2 +- .../destructuring-parameters/expected.js | 3 +- .../empty-arguments/expected.js | 2 +- .../arrow-functions/empty-block/expected.js | 3 +- .../arrow-functions/expression/expected.js | 2 +- .../arrow-functions/inside-call/expected.js | 2 +- .../multiple-arguments/expected.js | 2 +- .../arrow-functions/nested/expected.js | 26 ++++----- .../paran-insertion/expected.js | 2 +- .../single-argument/expected.js | 2 +- .../arrow-functions/statement/expected.js | 2 +- .../arrow-functions/this/expected.js | 4 +- .../classes/accessing-super-class/expected.js | 54 ++++++++----------- .../accessing-super-properties/expected.js | 19 +++---- .../calling-super-properties/expected.js | 32 +++++------ .../classes/constructor/expected.js | 19 +++---- .../instance-getter-and-setter/expected.js | 21 ++++---- .../classes/instance-getter/expected.js | 14 ++--- .../classes/instance-method/expected.js | 17 +++--- .../classes/instance-setter/expected.js | 14 ++--- .../classes/plain-class/expected.js | 2 +- .../classes/statement/expected.js | 26 ++++----- .../transformation/classes/static/expected.js | 13 +++-- .../expected.js | 24 ++++----- .../super-class-id-non-identifiers/actual.js | 4 +- .../expected.js | 19 +++---- .../classes/super-class/expected.js | 19 +++---- .../super-function-fallback/expected.js | 2 +- .../comments/preserve-multi-line/expected.js | 5 +- .../comments/preserve-single-line/expected.js | 3 +- .../argument/expected.js | 4 +- .../assignment/expected.js | 4 +- .../method/expected.js | 7 ++- .../computed-property-names/mixed/expected.js | 4 +- .../multiple/expected.js | 4 +- .../single/expected.js | 4 +- .../computed-property-names/this/expected.js | 6 +-- .../variable/expected.js | 4 +- .../constants/destructuring/expected.js | 5 +- .../constants/program/expected.js | 1 + .../default-parameters/multiple/expected.js | 16 ++---- .../default-parameters/single/expected.js | 6 +-- .../destructuring/array/expected.js | 1 + .../destructuring/assignment/expected.js | 1 + .../destructuring/empty/expected.js | 1 + .../destructuring/for-of/expected.js | 2 +- .../member-expression/expected.js | 3 +- .../destructuring/mixed/expected.js | 1 + .../destructuring/multiple/expected.js | 1 + .../destructuring/object-advanced/expected.js | 1 + .../destructuring/object-basic/expected.js | 1 + .../destructuring/parameters/expected.js | 2 +- .../for-of/identifier/expected.js | 2 +- .../transformation/for-of/let/expected.js | 2 +- .../for-of/multiple/expected.js | 5 +- .../transformation/for-of/var/expected.js | 2 +- .../transformation/jsx/annotation/expected.js | 3 +- .../transformation/jsx/empty/expected.js | 3 +- .../transformation/jsx/everything/expected.js | 6 +-- .../jsx/expressions/expected.js | 4 +- .../transformation/jsx/known-tags/expected.js | 1 + .../jsx/member-expression/expected.js | 1 + .../jsx/self-closing-tags/expected.js | 5 +- .../jsx/simple-tags/expected.js | 1 + .../jsx/tags-with-children/expected.js | 8 +-- .../jsx/tags-with-literals/expected.js | 4 ++ .../let-scoping/for-in-initializers/exec.js | 2 +- .../let-scoping/for-initializers/exec.js | 2 +- .../let-scoping/in-closure/exec.js | 2 +- .../let-scoping/nested-conflict/exec.js | 2 +- .../let-scoping/nested-function-1/exec.js | 2 +- .../let-scoping/nested-function-2/exec.js | 2 +- .../no-nested-function-declarations/actual.js | 2 +- .../modules-amd/exports-default/actual.js | 2 +- .../modules-amd/exports-default/expected.js | 14 ++--- .../modules-amd/exports-from/expected.js | 4 +- .../modules-amd/exports-named/expected.js | 2 +- .../modules-amd/exports-variable/expected.js | 5 +- .../hoist-function-exports/actual.js | 4 +- .../hoist-function-exports/expected.js | 12 ++--- .../modules-amd/imports-default/expected.js | 3 +- .../modules-amd/imports-glob/expected.js | 3 +- .../modules-amd/imports-mixing/expected.js | 2 +- .../modules-amd/imports-named/expected.js | 2 +- .../modules-amd/overview/expected.js | 3 +- .../modules-common/exports-default/actual.js | 2 +- .../exports-default/expected.js | 13 ++--- .../modules-common/exports-from/expected.js | 4 +- .../modules-common/exports-named/expected.js | 1 + .../exports-variable/expected.js | 6 +-- .../hoist-function-exports/actual.js | 4 +- .../hoist-function-exports/expected.js | 11 ++-- .../imports-default/expected.js | 1 + .../modules-common/imports-glob/expected.js | 1 + .../modules-common/imports-mixing/expected.js | 3 +- .../modules-common/imports-named/expected.js | 1 + .../modules-common/imports/expected.js | 3 ++ .../modules-common/overview/expected.js | 5 ++ .../modules-umd/exports-default/actual.js | 2 +- .../modules-umd/exports-default/expected.js | 14 ++--- .../modules-umd/exports-from/expected.js | 4 +- .../modules-umd/exports-named/expected.js | 2 +- .../modules-umd/exports-variable/expected.js | 5 +- .../hoist-function-exports/actual.js | 4 +- .../hoist-function-exports/expected.js | 12 ++--- .../modules-umd/imports-default/expected.js | 2 +- .../modules-umd/imports-glob/expected.js | 3 +- .../modules-umd/imports-mixing/expected.js | 3 +- .../modules-umd/imports-named/expected.js | 3 +- .../modules-umd/overview/expected.js | 4 +- .../getter-and-setter/expected.js | 21 ++++---- .../getter/expected.js | 14 ++--- .../method/expected.js | 8 ++- .../setter/expected.js | 14 ++--- .../single/expected.js | 4 +- .../actual.js | 2 +- .../expected.js | 5 +- .../react/display-name-if-missing/actual.js | 2 +- .../react/display-name-if-missing/expected.js | 3 +- .../display-name-object-declaration/actual.js | 2 +- .../expected.js | 15 +++--- .../actual.js | 2 +- .../expected.js | 3 +- .../actual.js | 2 +- .../expected.js | 3 +- .../arrow-functions/expected.js | 3 +- .../rest-parameters/multiple/expected.js | 4 +- .../rest-parameters/single/expected.js | 4 +- .../source-maps/arrow-function/expected.js | 5 +- .../arrow-function/source-mappings.json | 2 +- .../source-maps/class/expected.js | 7 ++- .../source-maps/class/source-mappings.json | 2 +- .../source-maps/full/expected.js | 2 +- .../source-maps/inline/expected.js | 4 +- .../spread/arguments/expected.js | 2 +- .../spread/array-literal-first/expected.js | 3 +- .../spread/array-literal-middle/expected.js | 3 +- .../spread/array-literal-multiple/expected.js | 3 +- .../spread/array-literals/expected.js | 1 + .../expected.js | 3 +- .../expected.js | 3 +- .../expected.js | 1 + .../expected.js | 1 + .../method-call-array-literal/expected.js | 1 + .../spread/method-call-first/expected.js | 3 +- .../spread/method-call-middle/expected.js | 3 +- .../method-call-multiple-args/expected.js | 1 + .../spread/method-call-multiple/expected.js | 3 +- .../spread/method-call-single-arg/expected.js | 1 + .../escape-quotes/expected.js | 1 + .../template-literals/functions/expected.js | 1 + .../template-literals/multiline/expected.js | 1 + .../template-literals/multiple/expected.js | 1 + .../template-literals/none/expected.js | 1 + .../template-literals/only/expected.js | 1 + .../template-literals/single/expected.js | 1 + .../template-literals/statement/expected.js | 1 + .../template-literals/tag/expected.js | 1 + .../unicode-regex/basic/expected.js | 6 +-- .../ignore-non-unicode/expected.js | 1 + .../transformation/use-strict/add/expected.js | 1 + .../use-strict/exists/expected.js | 1 + 172 files changed, 451 insertions(+), 494 deletions(-) diff --git a/lib/6to5/generator.js b/lib/6to5/generator.js index 2e61b17eee..02dd61d57a 100644 --- a/lib/6to5/generator.js +++ b/lib/6to5/generator.js @@ -60,7 +60,10 @@ CodeGenerator.prototype.newline = function (removeLast) { }; CodeGenerator.prototype.removeLastNewline = function () { - if (this.isLast("\n")) this.buf = this.buf.slice(0, -1); + if (this.isLast("\n")) { + this.buf = this.buf.slice(0, -1); + this.line--; + } }; CodeGenerator.prototype.semicolon = function () { @@ -189,6 +192,8 @@ CodeGenerator.prototype.printSequence = function (print, nodes, opts) { opts.print = function (node, i) { var needs = function (fn) { + if (!self.opts.whitespace) return; + if (node.start != null) { // user node if (!fn(node)) return; @@ -217,7 +222,7 @@ CodeGenerator.prototype.printSequence = function (print, nodes, opts) { }; CodeGenerator.prototype.hasWhitespaceBetween = function (startToken, endToken) { - if (!endToken || !this.opts.whitespace) return false; + if (!endToken) return false; var comments = this.ast.comments; diff --git a/test/fixtures/transformation/api/blacklist/expected.js b/test/fixtures/transformation/api/blacklist/expected.js index 01fd9509ac..18a766e0bc 100644 --- a/test/fixtures/transformation/api/blacklist/expected.js +++ b/test/fixtures/transformation/api/blacklist/expected.js @@ -2,4 +2,4 @@ var Test = function Test() { arr.map(x => x * x); -}; +}; \ No newline at end of file diff --git a/test/fixtures/transformation/api/whitelist/expected.js b/test/fixtures/transformation/api/whitelist/expected.js index 4d45519d18..1cd7a48990 100644 --- a/test/fixtures/transformation/api/whitelist/expected.js +++ b/test/fixtures/transformation/api/whitelist/expected.js @@ -1,7 +1,7 @@ class Test { - constructor() { - arr.map(function(x) { + constructor(){ + arr.map(function (x) { return x * x; }); } -} +} \ No newline at end of file diff --git a/test/fixtures/transformation/array-comprehension/arguments/expected.js b/test/fixtures/transformation/array-comprehension/arguments/expected.js index 954bd30308..b82dd052a0 100644 --- a/test/fixtures/transformation/array-comprehension/arguments/expected.js +++ b/test/fixtures/transformation/array-comprehension/arguments/expected.js @@ -2,8 +2,7 @@ function add() { var _arguments = arguments; - - return [1, 2, 3].map(function(i) { + return [1, 2, 3].map(function (i) { return i * _arguments[0]; }); } diff --git a/test/fixtures/transformation/array-comprehension/multiple-if/expected.js b/test/fixtures/transformation/array-comprehension/multiple-if/expected.js index 0d1c14d6b8..6fb7798e2a 100644 --- a/test/fixtures/transformation/array-comprehension/multiple-if/expected.js +++ b/test/fixtures/transformation/array-comprehension/multiple-if/expected.js @@ -1,10 +1,9 @@ "use strict"; -var seattlers = function() { +var seattlers = (function () { var _arr = []; - - countries.forEach(function(customers) { - customers.forEach(function(c) { + countries.forEach(function (customers) { + customers.forEach(function (c) { if (c.city == "Seattle") { _arr.push({ name: c.name, @@ -15,4 +14,4 @@ var seattlers = function() { }); return _arr; -}(); \ No newline at end of file +})(); \ No newline at end of file diff --git a/test/fixtures/transformation/array-comprehension/multiple/expected.js b/test/fixtures/transformation/array-comprehension/multiple/expected.js index 1bedd8be79..22935ecb9f 100644 --- a/test/fixtures/transformation/array-comprehension/multiple/expected.js +++ b/test/fixtures/transformation/array-comprehension/multiple/expected.js @@ -1,13 +1,12 @@ "use strict"; -var arr = function() { +var arr = (function () { var _arr = []; - - "abcdefgh".split("").forEach(function(x) { - "12345678".split("").forEach(function(y) { + "abcdefgh".split("").forEach(function (x) { + "12345678".split("").forEach(function (y) { _arr.push(x + y); }); }); return _arr; -}(); \ No newline at end of file +})(); \ No newline at end of file diff --git a/test/fixtures/transformation/array-comprehension/single-if/expected.js b/test/fixtures/transformation/array-comprehension/single-if/expected.js index a2d0917ebc..757bd236fd 100644 --- a/test/fixtures/transformation/array-comprehension/single-if/expected.js +++ b/test/fixtures/transformation/array-comprehension/single-if/expected.js @@ -1,8 +1,8 @@ "use strict"; -var seattlers = customers.filter(function(c) { +var seattlers = customers.filter(function (c) { return c.city == "Seattle"; -}).map(function(c) { +}).map(function (c) { return { name: c.name, age: c.age diff --git a/test/fixtures/transformation/array-comprehension/single/expected.js b/test/fixtures/transformation/array-comprehension/single/expected.js index 619ae58bec..754a2510f6 100644 --- a/test/fixtures/transformation/array-comprehension/single/expected.js +++ b/test/fixtures/transformation/array-comprehension/single/expected.js @@ -1,5 +1,5 @@ "use strict"; -var arr = [1, 2, 3].map(function(i) { +var arr = [1, 2, 3].map(function (i) { return i * i; }); \ No newline at end of file diff --git a/test/fixtures/transformation/array-comprehension/this/expected.js b/test/fixtures/transformation/array-comprehension/this/expected.js index d42443a592..4e26457098 100644 --- a/test/fixtures/transformation/array-comprehension/this/expected.js +++ b/test/fixtures/transformation/array-comprehension/this/expected.js @@ -2,12 +2,9 @@ function add() { var _this = this; - - return [1, 2, 3].map(function(i) { + return [1, 2, 3].map(function (i) { return i * _this.multiplier; }); } -add.call({ - multiplier: 5 -}); \ No newline at end of file +add.call({ multiplier: 5 }); \ No newline at end of file diff --git a/test/fixtures/transformation/arrow-functions/arguments/expected.js b/test/fixtures/transformation/arrow-functions/arguments/expected.js index 3b375c58d4..eab095659f 100644 --- a/test/fixtures/transformation/arrow-functions/arguments/expected.js +++ b/test/fixtures/transformation/arrow-functions/arguments/expected.js @@ -2,84 +2,63 @@ function one() { var _arguments = arguments; - - var inner = function() { + var inner = function () { return _arguments; }; - return [].slice.call(inner()); } - one(1, 2); function two() { var _arguments2 = arguments; - - var inner = function() { + var inner = function () { return _arguments2; }; - var another = function() { + var another = function () { var _arguments3 = arguments; - - var inner2 = function() { + var inner2 = function () { return _arguments3; }; }; return [].slice.call(inner()); } - two(1, 2); function three() { var _arguments4 = arguments; - - var fn = function() { + var fn = function () { return _arguments4[0] + "bar"; }; - return fn(); } - three("foo"); function four() { var _arguments5 = arguments; - - var fn = function() { + var fn = function () { return _arguments5[0].foo + "bar"; }; - return fn(); } - -four({ - foo: "foo" -}); +four({ foo: "foo" }); function five(obj) { - var fn = function() { + var fn = function () { return obj.arguments[0].foo + "bar"; }; - return fn(); } - -five({ - arguments: ["foo"] -}); +five({ arguments: ["foo"] }); function six(obj) { - var fn = function() { - var fn2 = function() { + var fn = function () { + var fn2 = function () { return arguments[0]; }; - return fn2("foobar"); }; - return fn(); } - six(); \ No newline at end of file diff --git a/test/fixtures/transformation/arrow-functions/default-parameters/expected.js b/test/fixtures/transformation/arrow-functions/default-parameters/expected.js index baba36b081..0fd9187e91 100644 --- a/test/fixtures/transformation/arrow-functions/default-parameters/expected.js +++ b/test/fixtures/transformation/arrow-functions/default-parameters/expected.js @@ -5,4 +5,4 @@ var some = function (count) { console.log("count", count); }; -some(); +some(); \ No newline at end of file diff --git a/test/fixtures/transformation/arrow-functions/destructuring-parameters/expected.js b/test/fixtures/transformation/arrow-functions/destructuring-parameters/expected.js index 07b761fb1a..806f033ff8 100644 --- a/test/fixtures/transformation/arrow-functions/destructuring-parameters/expected.js +++ b/test/fixtures/transformation/arrow-functions/destructuring-parameters/expected.js @@ -1,6 +1,7 @@ "use strict"; + var a = function (_ref) { var target = _ref.target; return console.log(target); }; -a({ target: "I am a target" }); +a({ target: "I am a target" }); \ No newline at end of file diff --git a/test/fixtures/transformation/arrow-functions/empty-arguments/expected.js b/test/fixtures/transformation/arrow-functions/empty-arguments/expected.js index b466d764b4..1607385d6f 100644 --- a/test/fixtures/transformation/arrow-functions/empty-arguments/expected.js +++ b/test/fixtures/transformation/arrow-functions/empty-arguments/expected.js @@ -1,5 +1,5 @@ "use strict"; -var t = function() { +var t = function () { return 5 + 5; }; \ No newline at end of file diff --git a/test/fixtures/transformation/arrow-functions/empty-block/expected.js b/test/fixtures/transformation/arrow-functions/empty-block/expected.js index ea38a60c98..903965434e 100644 --- a/test/fixtures/transformation/arrow-functions/empty-block/expected.js +++ b/test/fixtures/transformation/arrow-functions/empty-block/expected.js @@ -1,2 +1,3 @@ "use strict"; -var t = function() {}; \ No newline at end of file + +var t = function () {}; \ No newline at end of file diff --git a/test/fixtures/transformation/arrow-functions/expression/expected.js b/test/fixtures/transformation/arrow-functions/expression/expected.js index 9691f5dcbf..b38b216584 100644 --- a/test/fixtures/transformation/arrow-functions/expression/expected.js +++ b/test/fixtures/transformation/arrow-functions/expression/expected.js @@ -1,5 +1,5 @@ "use strict"; -arr.map(function(x) { +arr.map(function (x) { return x * x; }); \ No newline at end of file diff --git a/test/fixtures/transformation/arrow-functions/inside-call/expected.js b/test/fixtures/transformation/arrow-functions/inside-call/expected.js index aad9088914..79a9246a79 100644 --- a/test/fixtures/transformation/arrow-functions/inside-call/expected.js +++ b/test/fixtures/transformation/arrow-functions/inside-call/expected.js @@ -1,5 +1,5 @@ "use strict"; -arr.map(function(i) { +arr.map(function (i) { return i + 1; }); \ No newline at end of file diff --git a/test/fixtures/transformation/arrow-functions/multiple-arguments/expected.js b/test/fixtures/transformation/arrow-functions/multiple-arguments/expected.js index e1d0026d1e..7dcd6be55c 100644 --- a/test/fixtures/transformation/arrow-functions/multiple-arguments/expected.js +++ b/test/fixtures/transformation/arrow-functions/multiple-arguments/expected.js @@ -1,5 +1,5 @@ "use strict"; -var t = function(i, x) { +var t = function (i, x) { return i * x; }; \ No newline at end of file diff --git a/test/fixtures/transformation/arrow-functions/nested/expected.js b/test/fixtures/transformation/arrow-functions/nested/expected.js index dd88d22cb4..cba32c7b40 100644 --- a/test/fixtures/transformation/arrow-functions/nested/expected.js +++ b/test/fixtures/transformation/arrow-functions/nested/expected.js @@ -1,18 +1,14 @@ "use strict"; -module.exports = { - init: function() { - var _this = this; - - return new Promise(function(resolve, reject) { - MongoClient.connect(config.mongodb, function(err, db) { - if (err) { - return reject(err); - } - - _this.db = db; - resolve(_this); - }); +module.exports = { init: function () { + var _this = this; + return new Promise(function (resolve, reject) { + MongoClient.connect(config.mongodb, function (err, db) { + if (err) { + return reject(err); + } + _this.db = db; + resolve(_this); }); - } -}; \ No newline at end of file + }); +} }; \ No newline at end of file diff --git a/test/fixtures/transformation/arrow-functions/paran-insertion/expected.js b/test/fixtures/transformation/arrow-functions/paran-insertion/expected.js index 09605cc5a7..7ee476a8fc 100644 --- a/test/fixtures/transformation/arrow-functions/paran-insertion/expected.js +++ b/test/fixtures/transformation/arrow-functions/paran-insertion/expected.js @@ -1,5 +1,5 @@ "use strict"; -var t = function(i) { +var t = function (i) { return i * 5; }; \ No newline at end of file diff --git a/test/fixtures/transformation/arrow-functions/single-argument/expected.js b/test/fixtures/transformation/arrow-functions/single-argument/expected.js index 09605cc5a7..7ee476a8fc 100644 --- a/test/fixtures/transformation/arrow-functions/single-argument/expected.js +++ b/test/fixtures/transformation/arrow-functions/single-argument/expected.js @@ -1,5 +1,5 @@ "use strict"; -var t = function(i) { +var t = function (i) { return i * 5; }; \ No newline at end of file diff --git a/test/fixtures/transformation/arrow-functions/statement/expected.js b/test/fixtures/transformation/arrow-functions/statement/expected.js index ec15fece3a..f233cefd3b 100644 --- a/test/fixtures/transformation/arrow-functions/statement/expected.js +++ b/test/fixtures/transformation/arrow-functions/statement/expected.js @@ -1,6 +1,6 @@ "use strict"; -nums.forEach(function(v) { +nums.forEach(function (v) { if (v % 5 === 0) { fives.push(v); } diff --git a/test/fixtures/transformation/arrow-functions/this/expected.js b/test/fixtures/transformation/arrow-functions/this/expected.js index 6d2e107762..6006321301 100644 --- a/test/fixtures/transformation/arrow-functions/this/expected.js +++ b/test/fixtures/transformation/arrow-functions/this/expected.js @@ -1,6 +1,6 @@ "use strict"; -var _this = this; -var t = function(x) { +var _this = this; +var t = function (x) { return _this.x + x; }; \ No newline at end of file diff --git a/test/fixtures/transformation/classes/accessing-super-class/expected.js b/test/fixtures/transformation/classes/accessing-super-class/expected.js index 95530b559d..1a66b89026 100644 --- a/test/fixtures/transformation/classes/accessing-super-class/expected.js +++ b/test/fixtures/transformation/classes/accessing-super-class/expected.js @@ -1,60 +1,52 @@ "use strict"; var _slice = Array.prototype.slice; - var _classProps = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; var _extends = function (child, parent) { - child.prototype = Object.create(parent.prototype, { - constructor: { - value: child, - enumerable: false, - writable: true, - configurable: true - } - }); - + child.prototype = Object.create(parent.prototype, { constructor: { + value: child, + enumerable: false, + writable: true, + configurable: true + } }); child.__proto__ = parent; }; -var Test = function(Foo) { +var Test = (function (Foo) { var Test = function Test() { woops.super.test(); Foo.call(this); Foo.prototype.test.call(this); foob(Foo); + Foo.call.apply(Foo, [this].concat(_slice.call(arguments))); Foo.call.apply(Foo, [this, "test"].concat(_slice.call(arguments))); + Foo.prototype.test.call.apply(Foo.prototype, [this].concat(_slice.call(arguments))); Foo.prototype.test.call.apply(Foo.prototype, [this, "test"].concat(_slice.call(arguments))); }; _extends(Test, Foo); - _classProps(Test, { - foo: { - writable: true, - - value: function() { - Foo.foo.call(this); - Foo.foo.call.apply(Foo.foo, [this].concat(_slice.call(arguments))); - Foo.foo.call.apply(Foo.foo, [this, "test"].concat(_slice.call(arguments))); - } + _classProps(Test, { foo: { + writable: true, + value: function () { + Foo.foo.call(this); + Foo.foo.call.apply(Foo.foo, [this].concat(_slice.call(arguments))); + Foo.foo.call.apply(Foo.foo, [this, "test"].concat(_slice.call(arguments))); } - }, { - test: { - writable: true, - - value: function() { - Foo.prototype.test.call(this); - Foo.prototype.test.call.apply(Foo.prototype.test, [this].concat(_slice.call(arguments))); - Foo.prototype.test.call.apply(Foo.prototype.test, [this, "test"].concat(_slice.call(arguments))); - } + } }, { test: { + writable: true, + value: function () { + Foo.prototype.test.call(this); + Foo.prototype.test.call.apply(Foo.prototype.test, [this].concat(_slice.call(arguments))); + Foo.prototype.test.call.apply(Foo.prototype.test, [this, "test"].concat(_slice.call(arguments))); } - }); + } }); return Test; -}(Foo); +})(Foo); \ No newline at end of file diff --git a/test/fixtures/transformation/classes/accessing-super-properties/expected.js b/test/fixtures/transformation/classes/accessing-super-properties/expected.js index 87fc08e3fa..7c1ecd5407 100644 --- a/test/fixtures/transformation/classes/accessing-super-properties/expected.js +++ b/test/fixtures/transformation/classes/accessing-super-properties/expected.js @@ -1,19 +1,16 @@ "use strict"; var _extends = function (child, parent) { - child.prototype = Object.create(parent.prototype, { - constructor: { - value: child, - enumerable: false, - writable: true, - configurable: true - } - }); - + child.prototype = Object.create(parent.prototype, { constructor: { + value: child, + enumerable: false, + writable: true, + configurable: true + } }); child.__proto__ = parent; }; -var Test = function(Foo) { +var Test = (function (Foo) { var Test = function Test() { Foo.prototype.test; Foo.prototype.test.whatever; @@ -22,4 +19,4 @@ var Test = function(Foo) { _extends(Test, Foo); return Test; -}(Foo); +})(Foo); \ No newline at end of file diff --git a/test/fixtures/transformation/classes/calling-super-properties/expected.js b/test/fixtures/transformation/classes/calling-super-properties/expected.js index 80824f88ae..4c05f44f9f 100644 --- a/test/fixtures/transformation/classes/calling-super-properties/expected.js +++ b/test/fixtures/transformation/classes/calling-super-properties/expected.js @@ -6,19 +6,16 @@ var _classProps = function (child, staticProps, instanceProps) { }; var _extends = function (child, parent) { - child.prototype = Object.create(parent.prototype, { - constructor: { - value: child, - enumerable: false, - writable: true, - configurable: true - } - }); - + child.prototype = Object.create(parent.prototype, { constructor: { + value: child, + enumerable: false, + writable: true, + configurable: true + } }); child.__proto__ = parent; }; -var Test = function(Foo) { +var Test = (function (Foo) { var Test = function Test() { Foo.prototype.test.whatever(); Foo.prototype.test.call(this); @@ -26,15 +23,12 @@ var Test = function(Foo) { _extends(Test, Foo); - _classProps(Test, { - test: { - writable: true, - - value: function() { - return Foo.wow.call(this); - } + _classProps(Test, { test: { + writable: true, + value: function () { + return Foo.wow.call(this); } - }, null); + } }); return Test; -}(Foo); +})(Foo); diff --git a/test/fixtures/transformation/classes/constructor/expected.js b/test/fixtures/transformation/classes/constructor/expected.js index fcf8fb6aae..a80bf4ff51 100644 --- a/test/fixtures/transformation/classes/constructor/expected.js +++ b/test/fixtures/transformation/classes/constructor/expected.js @@ -1,15 +1,12 @@ "use strict"; var _extends = function (child, parent) { - child.prototype = Object.create(parent.prototype, { - constructor: { - value: child, - enumerable: false, - writable: true, - configurable: true - } - }); - + child.prototype = Object.create(parent.prototype, { constructor: { + value: child, + enumerable: false, + writable: true, + configurable: true + } }); child.__proto__ = parent; }; @@ -17,7 +14,7 @@ var Test = function Test() { this.state = "test"; }; -var Foo = function(Bar) { +var Foo = (function (Bar) { var Foo = function Foo() { this.state = "test"; }; @@ -25,4 +22,4 @@ var Foo = function(Bar) { _extends(Foo, Bar); return Foo; -}(Bar); +})(Bar); \ No newline at end of file diff --git a/test/fixtures/transformation/classes/instance-getter-and-setter/expected.js b/test/fixtures/transformation/classes/instance-getter-and-setter/expected.js index 5ab8570499..4fac2f3c97 100644 --- a/test/fixtures/transformation/classes/instance-getter-and-setter/expected.js +++ b/test/fixtures/transformation/classes/instance-getter-and-setter/expected.js @@ -5,20 +5,17 @@ var _classProps = function (child, staticProps, instanceProps) { if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; -var Test = function() { +var Test = (function () { var Test = function Test() {}; - _classProps(Test, null, { - test: { - get: function() { - return 5 + 5; - }, - - set: function(val) { - this._test = val; - } + _classProps(Test, null, { test: { + get: function () { + return 5 + 5; + }, + set: function (val) { + this._test = val; } - }); + } }); return Test; -}(); +})(); \ No newline at end of file diff --git a/test/fixtures/transformation/classes/instance-getter/expected.js b/test/fixtures/transformation/classes/instance-getter/expected.js index 60aaf32f08..d4cd4e15d0 100644 --- a/test/fixtures/transformation/classes/instance-getter/expected.js +++ b/test/fixtures/transformation/classes/instance-getter/expected.js @@ -5,16 +5,12 @@ var _classProps = function (child, staticProps, instanceProps) { if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; -var Test = function() { +var Test = (function () { var Test = function Test() {}; - _classProps(Test, null, { - test: { - get: function() { - return 5 + 5; - } - } - }); + _classProps(Test, null, { test: { get: function () { + return 5 + 5; + } } }); return Test; -}(); +})(); \ No newline at end of file diff --git a/test/fixtures/transformation/classes/instance-method/expected.js b/test/fixtures/transformation/classes/instance-method/expected.js index 50442620fa..bff68c8b99 100644 --- a/test/fixtures/transformation/classes/instance-method/expected.js +++ b/test/fixtures/transformation/classes/instance-method/expected.js @@ -5,18 +5,15 @@ var _classProps = function (child, staticProps, instanceProps) { if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; -var Test = function() { +var Test = (function () { var Test = function Test() {}; - _classProps(Test, null, { - test: { - writable: true, - - value: function() { - return 5 + 5; - } + _classProps(Test, null, { test: { + writable: true, + value: function () { + return 5 + 5; } - }); + } }); return Test; -}(); +})(); \ No newline at end of file diff --git a/test/fixtures/transformation/classes/instance-setter/expected.js b/test/fixtures/transformation/classes/instance-setter/expected.js index fb1e58c8eb..724bc8ee97 100644 --- a/test/fixtures/transformation/classes/instance-setter/expected.js +++ b/test/fixtures/transformation/classes/instance-setter/expected.js @@ -5,16 +5,12 @@ var _classProps = function (child, staticProps, instanceProps) { if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; -var Test = function() { +var Test = (function () { var Test = function Test() {}; - _classProps(Test, null, { - test: { - set: function(val) { - this._test = val; - } - } - }); + _classProps(Test, null, { test: { set: function (val) { + this._test = val; + } } }); return Test; -}(); +})(); \ No newline at end of file diff --git a/test/fixtures/transformation/classes/plain-class/expected.js b/test/fixtures/transformation/classes/plain-class/expected.js index 5f98760f68..d4f56f6237 100644 --- a/test/fixtures/transformation/classes/plain-class/expected.js +++ b/test/fixtures/transformation/classes/plain-class/expected.js @@ -1,3 +1,3 @@ "use strict"; -var Test = function Test() {}; +var Test = function Test() {}; \ No newline at end of file diff --git a/test/fixtures/transformation/classes/statement/expected.js b/test/fixtures/transformation/classes/statement/expected.js index 251f0329d7..1a31117543 100644 --- a/test/fixtures/transformation/classes/statement/expected.js +++ b/test/fixtures/transformation/classes/statement/expected.js @@ -1,25 +1,27 @@ "use strict"; +var _classProps = function (child, staticProps, instanceProps) { + if (staticProps) Object.defineProperties(child, staticProps); + if (instanceProps) Object.defineProperties(child.prototype, instanceProps); +}; + var BaseView = function BaseView() { this.autoRender = true; }; -var BaseView = function() { +var BaseView = function () { this.autoRender = true; }; +var BaseView = (function () { + var _class2 = function () {}; -var BaseView = function() { - var _class2 = function() {}; - - Object.defineProperties(_class2.prototype, { - foo: { - writable: true, - value: function() { - this.autoRender = true; - } + _classProps(_class2, null, { foo: { + writable: true, + value: function () { + this.autoRender = true; } - }); + } }); return _class2; -}(); +})(); diff --git a/test/fixtures/transformation/classes/static/expected.js b/test/fixtures/transformation/classes/static/expected.js index 52724c0c1b..a50fd266e8 100644 --- a/test/fixtures/transformation/classes/static/expected.js +++ b/test/fixtures/transformation/classes/static/expected.js @@ -5,20 +5,19 @@ var _classProps = function (child, staticProps, instanceProps) { if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; -var A = function() { +var A = (function () { var A = function A() {}; _classProps(A, { a: { writable: true, - value: function() {} + value: function () {} }, - b: { - get: function() {}, - set: function(b) {} + get: function () {}, + set: function (b) {} } - }, null); + }); return A; -}(); +})(); diff --git a/test/fixtures/transformation/classes/super-class-id-member-expression/expected.js b/test/fixtures/transformation/classes/super-class-id-member-expression/expected.js index c6c1a4081b..ea49e16e82 100644 --- a/test/fixtures/transformation/classes/super-class-id-member-expression/expected.js +++ b/test/fixtures/transformation/classes/super-class-id-member-expression/expected.js @@ -1,19 +1,16 @@ "use strict"; var _extends = function (child, parent) { - child.prototype = Object.create(parent.prototype, { - constructor: { - value: child, - enumerable: false, - writable: true, - configurable: true - } - }); - + child.prototype = Object.create(parent.prototype, { constructor: { + value: child, + enumerable: false, + writable: true, + configurable: true + } }); child.__proto__ = parent; }; -var BaseController = function(Chaplin) { +var BaseController = (function (Chaplin) { var BaseController = function BaseController() { Chaplin.Controller.apply(this, arguments); }; @@ -21,9 +18,8 @@ var BaseController = function(Chaplin) { _extends(BaseController, Chaplin.Controller); return BaseController; -}(Chaplin); - -var BaseController2 = function(Chaplin) { +})(Chaplin); +var BaseController2 = (function (Chaplin) { var BaseController2 = function BaseController2() { Chaplin.Controller.Another.apply(this, arguments); }; @@ -31,4 +27,4 @@ var BaseController2 = function(Chaplin) { _extends(BaseController2, Chaplin.Controller.Another); return BaseController2; -}(Chaplin); +})(Chaplin); \ No newline at end of file diff --git a/test/fixtures/transformation/classes/super-class-id-non-identifiers/actual.js b/test/fixtures/transformation/classes/super-class-id-non-identifiers/actual.js index 61658914b7..fd1a14904f 100644 --- a/test/fixtures/transformation/classes/super-class-id-non-identifiers/actual.js +++ b/test/fixtures/transformation/classes/super-class-id-non-identifiers/actual.js @@ -1,3 +1,3 @@ -class Q extends function() {} { - +class Q extends function () {} { + } diff --git a/test/fixtures/transformation/classes/super-class-id-non-identifiers/expected.js b/test/fixtures/transformation/classes/super-class-id-non-identifiers/expected.js index 61b8ece11d..dc0c70364f 100644 --- a/test/fixtures/transformation/classes/super-class-id-non-identifiers/expected.js +++ b/test/fixtures/transformation/classes/super-class-id-non-identifiers/expected.js @@ -1,19 +1,16 @@ "use strict"; var _extends = function (child, parent) { - child.prototype = Object.create(parent.prototype, { - constructor: { - value: child, - enumerable: false, - writable: true, - configurable: true - } - }); - + child.prototype = Object.create(parent.prototype, { constructor: { + value: child, + enumerable: false, + writable: true, + configurable: true + } }); child.__proto__ = parent; }; -var Q = function(_ref) { +var Q = (function (_ref) { var Q = function Q() { _ref.apply(this, arguments); }; @@ -21,4 +18,4 @@ var Q = function(_ref) { _extends(Q, _ref); return Q; -}(function() {}); +})(function () {}); \ No newline at end of file diff --git a/test/fixtures/transformation/classes/super-class/expected.js b/test/fixtures/transformation/classes/super-class/expected.js index 38a17bb449..423045d77f 100644 --- a/test/fixtures/transformation/classes/super-class/expected.js +++ b/test/fixtures/transformation/classes/super-class/expected.js @@ -1,19 +1,16 @@ "use strict"; var _extends = function (child, parent) { - child.prototype = Object.create(parent.prototype, { - constructor: { - value: child, - enumerable: false, - writable: true, - configurable: true - } - }); - + child.prototype = Object.create(parent.prototype, { constructor: { + value: child, + enumerable: false, + writable: true, + configurable: true + } }); child.__proto__ = parent; }; -var Test = function(Foo) { +var Test = (function (Foo) { var Test = function Test() { Foo.apply(this, arguments); }; @@ -21,4 +18,4 @@ var Test = function(Foo) { _extends(Test, Foo); return Test; -}(Foo); +})(Foo); \ No newline at end of file diff --git a/test/fixtures/transformation/classes/super-function-fallback/expected.js b/test/fixtures/transformation/classes/super-function-fallback/expected.js index e17e74db06..b2c09ca204 100644 --- a/test/fixtures/transformation/classes/super-function-fallback/expected.js +++ b/test/fixtures/transformation/classes/super-function-fallback/expected.js @@ -2,4 +2,4 @@ var Test = function Test() { Function.prototype.hasOwnProperty.call(this, "test"); -}; +}; \ No newline at end of file diff --git a/test/fixtures/transformation/comments/preserve-multi-line/expected.js b/test/fixtures/transformation/comments/preserve-multi-line/expected.js index 1af4bf8949..0bf997ff51 100644 --- a/test/fixtures/transformation/comments/preserve-multi-line/expected.js +++ b/test/fixtures/transformation/comments/preserve-multi-line/expected.js @@ -1,6 +1,9 @@ "use strict"; + wow; + /* um yeah lol */ -test.wow(); + +test.wow(); \ No newline at end of file diff --git a/test/fixtures/transformation/comments/preserve-single-line/expected.js b/test/fixtures/transformation/comments/preserve-single-line/expected.js index 5ae1bb997c..07468c0c5b 100644 --- a/test/fixtures/transformation/comments/preserve-single-line/expected.js +++ b/test/fixtures/transformation/comments/preserve-single-line/expected.js @@ -1,4 +1,5 @@ "use strict"; + wow; // um yeah lol -test.wow(); +test.wow(); \ No newline at end of file diff --git a/test/fixtures/transformation/computed-property-names/argument/expected.js b/test/fixtures/transformation/computed-property-names/argument/expected.js index c0a552041c..fa1e508502 100644 --- a/test/fixtures/transformation/computed-property-names/argument/expected.js +++ b/test/fixtures/transformation/computed-property-names/argument/expected.js @@ -1,6 +1,6 @@ "use strict"; -foo(function(_ref) { +foo((function (_ref) { _ref[bar] = "foobar"; return _ref; -}({})); \ No newline at end of file +})({})); \ No newline at end of file diff --git a/test/fixtures/transformation/computed-property-names/assignment/expected.js b/test/fixtures/transformation/computed-property-names/assignment/expected.js index 32ec3eae9a..18c69fa732 100644 --- a/test/fixtures/transformation/computed-property-names/assignment/expected.js +++ b/test/fixtures/transformation/computed-property-names/assignment/expected.js @@ -1,6 +1,6 @@ "use strict"; -foo = function(_foo) { +foo = (function (_foo) { _foo[bar] = "foobar"; return _foo; -}({}); \ No newline at end of file +})({}); \ No newline at end of file diff --git a/test/fixtures/transformation/computed-property-names/method/expected.js b/test/fixtures/transformation/computed-property-names/method/expected.js index 198f336e49..c85e85d2ed 100644 --- a/test/fixtures/transformation/computed-property-names/method/expected.js +++ b/test/fixtures/transformation/computed-property-names/method/expected.js @@ -1,9 +1,8 @@ "use strict"; -var obj = function(_obj) { - _obj[foobar] = function() { +var obj = (function (_obj) { + _obj[foobar] = function () { return "foobar"; }; - return _obj; -}({}); \ No newline at end of file +})({}); \ No newline at end of file diff --git a/test/fixtures/transformation/computed-property-names/mixed/expected.js b/test/fixtures/transformation/computed-property-names/mixed/expected.js index 41bbf61c83..314531917a 100644 --- a/test/fixtures/transformation/computed-property-names/mixed/expected.js +++ b/test/fixtures/transformation/computed-property-names/mixed/expected.js @@ -1,10 +1,10 @@ "use strict"; -var obj = function(_obj) { +var obj = (function (_obj) { _obj["x" + foo] = "heh"; _obj["y" + bar] = "noo"; return _obj; -}({ +})({ foo: "foo", bar: "bar" }); \ No newline at end of file diff --git a/test/fixtures/transformation/computed-property-names/multiple/expected.js b/test/fixtures/transformation/computed-property-names/multiple/expected.js index a922fb279a..cdccd2e6b8 100644 --- a/test/fixtures/transformation/computed-property-names/multiple/expected.js +++ b/test/fixtures/transformation/computed-property-names/multiple/expected.js @@ -1,7 +1,7 @@ "use strict"; -var obj = function(_obj) { +var obj = (function (_obj) { _obj["x" + foo] = "heh"; _obj["y" + bar] = "noo"; return _obj; -}({}); \ No newline at end of file +})({}); \ No newline at end of file diff --git a/test/fixtures/transformation/computed-property-names/single/expected.js b/test/fixtures/transformation/computed-property-names/single/expected.js index d1ddd8d1b0..068ebfece9 100644 --- a/test/fixtures/transformation/computed-property-names/single/expected.js +++ b/test/fixtures/transformation/computed-property-names/single/expected.js @@ -1,6 +1,6 @@ "use strict"; -var obj = function(_obj) { +var obj = (function (_obj) { _obj["x" + foo] = "heh"; return _obj; -}({}); \ No newline at end of file +})({}); \ No newline at end of file diff --git a/test/fixtures/transformation/computed-property-names/this/expected.js b/test/fixtures/transformation/computed-property-names/this/expected.js index 958a6e472c..5a5d21d479 100644 --- a/test/fixtures/transformation/computed-property-names/this/expected.js +++ b/test/fixtures/transformation/computed-property-names/this/expected.js @@ -1,7 +1,7 @@ "use strict"; -var _this = this; -var obj = function(_obj) { +var _this = this; +var obj = (function (_obj) { _obj["x" + _this.foo] = "heh"; return _obj; -}({}); \ No newline at end of file +})({}); \ No newline at end of file diff --git a/test/fixtures/transformation/computed-property-names/variable/expected.js b/test/fixtures/transformation/computed-property-names/variable/expected.js index 6f6fcc0fd8..1f3bcd3f53 100644 --- a/test/fixtures/transformation/computed-property-names/variable/expected.js +++ b/test/fixtures/transformation/computed-property-names/variable/expected.js @@ -1,6 +1,6 @@ "use strict"; -var foo = function(_foo) { +var foo = (function (_foo) { _foo[bar] = "foobar"; return _foo; -}({}); \ No newline at end of file +})({}); \ No newline at end of file diff --git a/test/fixtures/transformation/constants/destructuring/expected.js b/test/fixtures/transformation/constants/destructuring/expected.js index 5447639209..9211b2c3ed 100644 --- a/test/fixtures/transformation/constants/destructuring/expected.js +++ b/test/fixtures/transformation/constants/destructuring/expected.js @@ -1,23 +1,20 @@ "use strict"; + var _ref = [1, 2]; var _a = _ref[0]; var _b = _ref[1]; var _ref2 = [3, 4]; var _c = _ref2[0]; var _d = _ref2[1]; - var _ref3 = { e: 5, f: 6 }; - var _e = _ref3.e; var _f = _ref3.f; - var _ref4 = { a: 7, b: 8 }; - var _g = _ref4.a; var _h = _ref4.b; \ No newline at end of file diff --git a/test/fixtures/transformation/constants/program/expected.js b/test/fixtures/transformation/constants/program/expected.js index 893bf38e7a..9f78d1ebea 100644 --- a/test/fixtures/transformation/constants/program/expected.js +++ b/test/fixtures/transformation/constants/program/expected.js @@ -1,4 +1,5 @@ "use strict"; + var _MULTIPLIER = 5; for (var i in arr) { diff --git a/test/fixtures/transformation/default-parameters/multiple/expected.js b/test/fixtures/transformation/default-parameters/multiple/expected.js index fb322b482d..c415d8c70c 100644 --- a/test/fixtures/transformation/default-parameters/multiple/expected.js +++ b/test/fixtures/transformation/default-parameters/multiple/expected.js @@ -1,18 +1,12 @@ "use strict"; -var t = function(t, f) { - if (f === undefined) - f = 5; - - if (t === undefined) - t = "foo"; - +var t = function (t, f) { + if (f === undefined) f = 5; + if (t === undefined) t = "foo"; return t + " bar " + f; }; -var a = function(t, f) { - if (f === undefined) - f = 5; - +var a = function (t, f) { + if (f === undefined) f = 5; return t + " bar " + f; }; \ No newline at end of file diff --git a/test/fixtures/transformation/default-parameters/single/expected.js b/test/fixtures/transformation/default-parameters/single/expected.js index 173a0d6e82..8cf069d6fc 100644 --- a/test/fixtures/transformation/default-parameters/single/expected.js +++ b/test/fixtures/transformation/default-parameters/single/expected.js @@ -1,8 +1,6 @@ "use strict"; -var t = function(t) { - if (t === undefined) - t = "foo"; - +var t = function (t) { + if (t === undefined) t = "foo"; return t + " bar"; }; \ No newline at end of file diff --git a/test/fixtures/transformation/destructuring/array/expected.js b/test/fixtures/transformation/destructuring/array/expected.js index 46ab026397..a9fecd9285 100644 --- a/test/fixtures/transformation/destructuring/array/expected.js +++ b/test/fixtures/transformation/destructuring/array/expected.js @@ -1,4 +1,5 @@ "use strict"; + var _ref = ["hello", [", ", "junk"], ["world"]]; var a = _ref[0]; var b = _ref[1][0]; diff --git a/test/fixtures/transformation/destructuring/assignment/expected.js b/test/fixtures/transformation/destructuring/assignment/expected.js index e018068ea7..cc933660fe 100644 --- a/test/fixtures/transformation/destructuring/assignment/expected.js +++ b/test/fixtures/transformation/destructuring/assignment/expected.js @@ -1,4 +1,5 @@ "use strict"; + var _ref = f(); a = _ref[0]; b = _ref[1]; \ No newline at end of file diff --git a/test/fixtures/transformation/destructuring/empty/expected.js b/test/fixtures/transformation/destructuring/empty/expected.js index 19ba8f8c45..0e8947615d 100644 --- a/test/fixtures/transformation/destructuring/empty/expected.js +++ b/test/fixtures/transformation/destructuring/empty/expected.js @@ -1,4 +1,5 @@ "use strict"; + var _ref = ["foo", "hello", [", ", "junk"], ["world"]]; var a = _ref[1]; var b = _ref[2][0]; diff --git a/test/fixtures/transformation/destructuring/for-of/expected.js b/test/fixtures/transformation/destructuring/for-of/expected.js index 37b42ad4c5..92e6b21ed3 100644 --- a/test/fixtures/transformation/destructuring/for-of/expected.js +++ b/test/fixtures/transformation/destructuring/for-of/expected.js @@ -1,6 +1,6 @@ "use strict"; -for (var _iterator = this.test.expectation.registers[Symbol.iterator](), _step; !(_step = _iterator.next()).done; ) { +for (var _iterator = this.test.expectation.registers[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { var _ref = _step.value; var name = _ref[0]; var before = _ref[1]; diff --git a/test/fixtures/transformation/destructuring/member-expression/expected.js b/test/fixtures/transformation/destructuring/member-expression/expected.js index aa888679f1..2c69800a4f 100644 --- a/test/fixtures/transformation/destructuring/member-expression/expected.js +++ b/test/fixtures/transformation/destructuring/member-expression/expected.js @@ -1,4 +1,5 @@ "use strict"; + var _ref = [1, 2]; this.foo = _ref[0]; -this.bar = _ref[1]; +this.bar = _ref[1]; \ No newline at end of file diff --git a/test/fixtures/transformation/destructuring/mixed/expected.js b/test/fixtures/transformation/destructuring/mixed/expected.js index f627baae57..3a7cae0ef3 100644 --- a/test/fixtures/transformation/destructuring/mixed/expected.js +++ b/test/fixtures/transformation/destructuring/mixed/expected.js @@ -1,4 +1,5 @@ "use strict"; + var x1 = rect.topLeft[0]; var y1 = rect.topLeft[1]; var x2 = rect.bottomRight[0]; diff --git a/test/fixtures/transformation/destructuring/multiple/expected.js b/test/fixtures/transformation/destructuring/multiple/expected.js index 5265295a8e..039184fd2c 100644 --- a/test/fixtures/transformation/destructuring/multiple/expected.js +++ b/test/fixtures/transformation/destructuring/multiple/expected.js @@ -1,4 +1,5 @@ "use strict"; + var x = coords.x; var y = coords.y; var foo = "bar"; \ No newline at end of file diff --git a/test/fixtures/transformation/destructuring/object-advanced/expected.js b/test/fixtures/transformation/destructuring/object-advanced/expected.js index 4936464371..00af4c96da 100644 --- a/test/fixtures/transformation/destructuring/object-advanced/expected.js +++ b/test/fixtures/transformation/destructuring/object-advanced/expected.js @@ -1,4 +1,5 @@ "use strict"; + var x1 = rect.topLeft.x; var y1 = rect.topLeft.y; var x2 = rect.bottomRight.x; diff --git a/test/fixtures/transformation/destructuring/object-basic/expected.js b/test/fixtures/transformation/destructuring/object-basic/expected.js index 544897c6e4..2794ae6038 100644 --- a/test/fixtures/transformation/destructuring/object-basic/expected.js +++ b/test/fixtures/transformation/destructuring/object-basic/expected.js @@ -1,3 +1,4 @@ "use strict"; + var x = coords.x; var y = coords.y; \ No newline at end of file diff --git a/test/fixtures/transformation/destructuring/parameters/expected.js b/test/fixtures/transformation/destructuring/parameters/expected.js index fe88a098a3..8685c9a6f5 100644 --- a/test/fixtures/transformation/destructuring/parameters/expected.js +++ b/test/fixtures/transformation/destructuring/parameters/expected.js @@ -18,7 +18,7 @@ console.log(unpackObject({ author: "author" })); -var unpackArray = function(_ref3, _ref4) { +var unpackArray = function (_ref3, _ref4) { var a = _ref3[0]; var b = _ref3[1]; var c = _ref3[2]; diff --git a/test/fixtures/transformation/for-of/identifier/expected.js b/test/fixtures/transformation/for-of/identifier/expected.js index 473b0db507..9aa48b1ad6 100644 --- a/test/fixtures/transformation/for-of/identifier/expected.js +++ b/test/fixtures/transformation/for-of/identifier/expected.js @@ -1,5 +1,5 @@ "use strict"; -for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done; ) { +for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { i = _step.value; } \ No newline at end of file diff --git a/test/fixtures/transformation/for-of/let/expected.js b/test/fixtures/transformation/for-of/let/expected.js index 21113f9fe9..e16dad7c33 100644 --- a/test/fixtures/transformation/for-of/let/expected.js +++ b/test/fixtures/transformation/for-of/let/expected.js @@ -1,5 +1,5 @@ "use strict"; -for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done; ) { +for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { var _i = _step.value; } \ No newline at end of file diff --git a/test/fixtures/transformation/for-of/multiple/expected.js b/test/fixtures/transformation/for-of/multiple/expected.js index ba12446e35..ab198b7441 100644 --- a/test/fixtures/transformation/for-of/multiple/expected.js +++ b/test/fixtures/transformation/for-of/multiple/expected.js @@ -1,9 +1,8 @@ "use strict"; -for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done; ) { +for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { var i = _step.value; } - -for (var _iterator2 = numbers[Symbol.iterator](), _step2; !(_step2 = _iterator2.next()).done; ) { +for (var _iterator2 = numbers[Symbol.iterator](), _step2; !(_step2 = _iterator2.next()).done;) { var i = _step2.value; } \ No newline at end of file diff --git a/test/fixtures/transformation/for-of/var/expected.js b/test/fixtures/transformation/for-of/var/expected.js index 943b187ac7..50b4846307 100644 --- a/test/fixtures/transformation/for-of/var/expected.js +++ b/test/fixtures/transformation/for-of/var/expected.js @@ -1,5 +1,5 @@ "use strict"; -for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done; ) { +for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { var i = _step.value; } \ No newline at end of file diff --git a/test/fixtures/transformation/jsx/annotation/expected.js b/test/fixtures/transformation/jsx/annotation/expected.js index 2069c82ded..0d5a65d027 100644 --- a/test/fixtures/transformation/jsx/annotation/expected.js +++ b/test/fixtures/transformation/jsx/annotation/expected.js @@ -1,5 +1,4 @@ /** @jsx CUSTOM_DOM */ - "use strict"; -CUSTOM_DOM.a(null); +CUSTOM_DOM.a(null); \ No newline at end of file diff --git a/test/fixtures/transformation/jsx/empty/expected.js b/test/fixtures/transformation/jsx/empty/expected.js index 1a956a0747..6d37224243 100644 --- a/test/fixtures/transformation/jsx/empty/expected.js +++ b/test/fixtures/transformation/jsx/empty/expected.js @@ -1,2 +1,3 @@ "use strict"; -X(null, null); + +X(null, null); \ No newline at end of file diff --git a/test/fixtures/transformation/jsx/everything/expected.js b/test/fixtures/transformation/jsx/everything/expected.js index 7d39e64fbc..a4440ed7e3 100644 --- a/test/fixtures/transformation/jsx/everything/expected.js +++ b/test/fixtures/transformation/jsx/everything/expected.js @@ -1,7 +1,3 @@ "use strict"; -X({ - "data-prop": (x ? Y({ - prop: 2 - }) : Z(null, "\n")) -}); \ No newline at end of file +X({ "data-prop": x ? Y({ prop: 2 }) : Z(null, "\n") }); \ No newline at end of file diff --git a/test/fixtures/transformation/jsx/expressions/expected.js b/test/fixtures/transformation/jsx/expressions/expected.js index ff1185a7ba..a7ab72bd9c 100644 --- a/test/fixtures/transformation/jsx/expressions/expected.js +++ b/test/fixtures/transformation/jsx/expressions/expected.js @@ -1,8 +1,10 @@ "use strict"; + X(null, a); + X(null, a, " ", b); X({ prop: a, yes: true -}); +}); \ No newline at end of file diff --git a/test/fixtures/transformation/jsx/known-tags/expected.js b/test/fixtures/transformation/jsx/known-tags/expected.js index ec70567216..3a02eece90 100644 --- a/test/fixtures/transformation/jsx/known-tags/expected.js +++ b/test/fixtures/transformation/jsx/known-tags/expected.js @@ -1,2 +1,3 @@ "use strict"; + React.DOM.a(null); \ No newline at end of file diff --git a/test/fixtures/transformation/jsx/member-expression/expected.js b/test/fixtures/transformation/jsx/member-expression/expected.js index 4dea12440d..2a43047839 100644 --- a/test/fixtures/transformation/jsx/member-expression/expected.js +++ b/test/fixtures/transformation/jsx/member-expression/expected.js @@ -1,2 +1,3 @@ "use strict"; + Test.X(null); \ No newline at end of file diff --git a/test/fixtures/transformation/jsx/self-closing-tags/expected.js b/test/fixtures/transformation/jsx/self-closing-tags/expected.js index 3ebb174fab..18cac16984 100644 --- a/test/fixtures/transformation/jsx/self-closing-tags/expected.js +++ b/test/fixtures/transformation/jsx/self-closing-tags/expected.js @@ -1,6 +1,5 @@ "use strict"; + X(null); -X({ - prop: "1" -}); \ No newline at end of file +X({ prop: "1" }); \ No newline at end of file diff --git a/test/fixtures/transformation/jsx/simple-tags/expected.js b/test/fixtures/transformation/jsx/simple-tags/expected.js index f38433898c..b7bbfe9f22 100644 --- a/test/fixtures/transformation/jsx/simple-tags/expected.js +++ b/test/fixtures/transformation/jsx/simple-tags/expected.js @@ -1,2 +1,3 @@ "use strict"; + X(null); \ No newline at end of file diff --git a/test/fixtures/transformation/jsx/tags-with-children/expected.js b/test/fixtures/transformation/jsx/tags-with-children/expected.js index 7af3674f0f..5f3cb3bdca 100644 --- a/test/fixtures/transformation/jsx/tags-with-children/expected.js +++ b/test/fixtures/transformation/jsx/tags-with-children/expected.js @@ -1,9 +1,5 @@ "use strict"; -X({ - prop: "2" -}, Y(null)); +X({ prop: "2" }, Y(null)); -X({ - prop: "2" -}, Y(null), Z(null)); +X({ prop: "2" }, Y(null), Z(null)); \ No newline at end of file diff --git a/test/fixtures/transformation/jsx/tags-with-literals/expected.js b/test/fixtures/transformation/jsx/tags-with-literals/expected.js index 956943003e..60330adaee 100644 --- a/test/fixtures/transformation/jsx/tags-with-literals/expected.js +++ b/test/fixtures/transformation/jsx/tags-with-literals/expected.js @@ -1,5 +1,9 @@ "use strict"; + X(null, " "); + X(null, "\n"); + X(null, "\n string\n"); + X(null, "\n string\n string\n "); \ No newline at end of file diff --git a/test/fixtures/transformation/let-scoping/for-in-initializers/exec.js b/test/fixtures/transformation/let-scoping/for-in-initializers/exec.js index eb713cd261..fdc846c5b0 100644 --- a/test/fixtures/transformation/let-scoping/for-in-initializers/exec.js +++ b/test/fixtures/transformation/let-scoping/for-in-initializers/exec.js @@ -5,7 +5,7 @@ var result; for (var index in let_array) { let let_index = index; let let_value = let_array[let_index]; - let_result.push(function() { + let_result.push(function () { return [let_index, let_value]; }); } diff --git a/test/fixtures/transformation/let-scoping/for-initializers/exec.js b/test/fixtures/transformation/let-scoping/for-initializers/exec.js index ec382cc595..37484f804b 100644 --- a/test/fixtures/transformation/let-scoping/for-initializers/exec.js +++ b/test/fixtures/transformation/let-scoping/for-initializers/exec.js @@ -4,7 +4,7 @@ var result; let let_l = []; for (var var_x = 1, var_y = 2, var_z = 3; var_x < 10; var_x ++) { let l_x = var_x, l_y = var_y, l_z = var_z; - let_l.push(function() { + let_l.push(function () { return [l_x, l_y, l_z]; }); } diff --git a/test/fixtures/transformation/let-scoping/in-closure/exec.js b/test/fixtures/transformation/let-scoping/in-closure/exec.js index 3394671528..5a977f7033 100644 --- a/test/fixtures/transformation/let-scoping/in-closure/exec.js +++ b/test/fixtures/transformation/let-scoping/in-closure/exec.js @@ -5,7 +5,7 @@ function letInClosure(n) { if (i % 3 == 0) { continue; } - l.push(function() { + l.push(function () { return let_i; }); } diff --git a/test/fixtures/transformation/let-scoping/nested-conflict/exec.js b/test/fixtures/transformation/let-scoping/nested-conflict/exec.js index 6bb300a67f..4243019c5f 100644 --- a/test/fixtures/transformation/let-scoping/nested-conflict/exec.js +++ b/test/fixtures/transformation/let-scoping/nested-conflict/exec.js @@ -1,4 +1,4 @@ -(function() { +(function () { var x = 1; function f() { assert.equal(x, 1); diff --git a/test/fixtures/transformation/let-scoping/nested-function-1/exec.js b/test/fixtures/transformation/let-scoping/nested-function-1/exec.js index c6080cffbe..617db23c44 100644 --- a/test/fixtures/transformation/let-scoping/nested-function-1/exec.js +++ b/test/fixtures/transformation/let-scoping/nested-function-1/exec.js @@ -1,5 +1,5 @@ function nestedFunction1() { - return function() { + return function () { let let_x = 'let x'; } } diff --git a/test/fixtures/transformation/let-scoping/nested-function-2/exec.js b/test/fixtures/transformation/let-scoping/nested-function-2/exec.js index 0888e44034..f993f344c2 100644 --- a/test/fixtures/transformation/let-scoping/nested-function-2/exec.js +++ b/test/fixtures/transformation/let-scoping/nested-function-2/exec.js @@ -1,5 +1,5 @@ function nestedFunction2() { - let let_func = function() { + let let_func = function () { let let_x = 'let x'; } return let_func; diff --git a/test/fixtures/transformation/let-scoping/no-nested-function-declarations/actual.js b/test/fixtures/transformation/let-scoping/no-nested-function-declarations/actual.js index 880c5290be..dc5a13878d 100644 --- a/test/fixtures/transformation/let-scoping/no-nested-function-declarations/actual.js +++ b/test/fixtures/transformation/let-scoping/no-nested-function-declarations/actual.js @@ -2,6 +2,6 @@ var numbers = [1, 2, 3]; for (let i in numbers) { function foo() { - return i; + return i; } } diff --git a/test/fixtures/transformation/modules-amd/exports-default/actual.js b/test/fixtures/transformation/modules-amd/exports-default/actual.js index d7c96201d6..62923e5c15 100644 --- a/test/fixtures/transformation/modules-amd/exports-default/actual.js +++ b/test/fixtures/transformation/modules-amd/exports-default/actual.js @@ -5,4 +5,4 @@ export default foo; export default function () {} export default class {} export default function foo () {} -export default class foo {} +export default class Foo {} diff --git a/test/fixtures/transformation/modules-amd/exports-default/expected.js b/test/fixtures/transformation/modules-amd/exports-default/expected.js index 4f9aa2bd7a..47ac3d0bb3 100644 --- a/test/fixtures/transformation/modules-amd/exports-default/expected.js +++ b/test/fixtures/transformation/modules-amd/exports-default/expected.js @@ -5,11 +5,11 @@ define(["exports"], function (exports) { exports.default = {}; exports.default = []; exports.default = foo; - exports.default = function() {}; + exports.default = function () {}; + exports.default = function () {}; + function foo() {} + exports.default = foo; + function Foo() {} - exports.default = function() {}; - - exports.default = function foo() {}; - - exports.default = function foo() {}; -}); + exports.default = Foo; +}); \ No newline at end of file diff --git a/test/fixtures/transformation/modules-amd/exports-from/expected.js b/test/fixtures/transformation/modules-amd/exports-from/expected.js index c07afa4b5d..a53ede7919 100644 --- a/test/fixtures/transformation/modules-amd/exports-from/expected.js +++ b/test/fixtures/transformation/modules-amd/exports-from/expected.js @@ -1,7 +1,7 @@ define(["exports", "foo"], function (exports, _foo) { "use strict"; - (function(obj) { + (function (obj) { for (var i in obj) { exports[i] = obj[i]; } @@ -14,4 +14,4 @@ define(["exports", "foo"], function (exports, _foo) { exports.default = _foo.foo; exports.default = _foo.foo; exports.bar = _foo.bar; -}); +}); \ No newline at end of file diff --git a/test/fixtures/transformation/modules-amd/exports-named/expected.js b/test/fixtures/transformation/modules-amd/exports-named/expected.js index 2bdf3ee4d1..f4b7c61175 100644 --- a/test/fixtures/transformation/modules-amd/exports-named/expected.js +++ b/test/fixtures/transformation/modules-amd/exports-named/expected.js @@ -8,4 +8,4 @@ define(["exports"], function (exports) { exports.default = foo; exports.default = foo; exports.bar = bar; -}); +}); \ No newline at end of file diff --git a/test/fixtures/transformation/modules-amd/exports-variable/expected.js b/test/fixtures/transformation/modules-amd/exports-variable/expected.js index ae135f88f3..74e379fc1a 100644 --- a/test/fixtures/transformation/modules-amd/exports-variable/expected.js +++ b/test/fixtures/transformation/modules-amd/exports-variable/expected.js @@ -4,7 +4,7 @@ define(["exports"], function (exports) { exports.foo7 = foo7; var foo = 1; exports.foo = foo; - var foo2 = function() {}; + var foo2 = function () {}; exports.foo2 = foo2; var foo3; exports.foo3 = foo3; @@ -15,8 +15,7 @@ define(["exports"], function (exports) { var _foo6 = 3; exports.foo6 = _foo6; function foo7() {} - var foo8 = function foo8() {}; exports.foo8 = foo8; -}); +}); \ No newline at end of file diff --git a/test/fixtures/transformation/modules-amd/hoist-function-exports/actual.js b/test/fixtures/transformation/modules-amd/hoist-function-exports/actual.js index aa0f9366ae..d0af5b7592 100644 --- a/test/fixtures/transformation/modules-amd/hoist-function-exports/actual.js +++ b/test/fixtures/transformation/modules-amd/hoist-function-exports/actual.js @@ -4,8 +4,8 @@ export function nextOdd(n) { return isEven(n) ? n + 1 : n + 2; } -export var isOdd = (function(isEven) { - return function(n) { +export var isOdd = (function (isEven) { + return function (n) { return !isEven(n); }; })(isEven); diff --git a/test/fixtures/transformation/modules-amd/hoist-function-exports/expected.js b/test/fixtures/transformation/modules-amd/hoist-function-exports/expected.js index 902cf1a327..c5ab9169c8 100644 --- a/test/fixtures/transformation/modules-amd/hoist-function-exports/expected.js +++ b/test/fixtures/transformation/modules-amd/hoist-function-exports/expected.js @@ -3,16 +3,14 @@ define(["exports", "./evens"], function (exports, _evens) { exports.nextOdd = nextOdd; var isEven = _evens.isEven; - function nextOdd(n) { - return (isEven(n) ? n + 1 : n + 2); + return isEven(n) ? n + 1 : n + 2; } - var isOdd = function(isEven) { - return function(n) { + var isOdd = (function (isEven) { + return function (n) { return !isEven(n); }; - }(isEven); - + })(isEven); exports.isOdd = isOdd; -}); +}); \ No newline at end of file diff --git a/test/fixtures/transformation/modules-amd/imports-default/expected.js b/test/fixtures/transformation/modules-amd/imports-default/expected.js index 7febc6bc17..629617760f 100644 --- a/test/fixtures/transformation/modules-amd/imports-default/expected.js +++ b/test/fixtures/transformation/modules-amd/imports-default/expected.js @@ -1,5 +1,6 @@ define(["exports", "foo"], function (exports, _foo) { "use strict"; + var foo = _foo.default; var foo = _foo.default; -}); +}); \ No newline at end of file diff --git a/test/fixtures/transformation/modules-amd/imports-glob/expected.js b/test/fixtures/transformation/modules-amd/imports-glob/expected.js index 5c42e9d59a..cc03946787 100644 --- a/test/fixtures/transformation/modules-amd/imports-glob/expected.js +++ b/test/fixtures/transformation/modules-amd/imports-glob/expected.js @@ -1,4 +1,5 @@ define(["exports", "foo"], function (exports, _foo) { "use strict"; + var foo = _foo; -}); +}); \ No newline at end of file diff --git a/test/fixtures/transformation/modules-amd/imports-mixing/expected.js b/test/fixtures/transformation/modules-amd/imports-mixing/expected.js index 37eced8d5b..1c10b7815a 100644 --- a/test/fixtures/transformation/modules-amd/imports-mixing/expected.js +++ b/test/fixtures/transformation/modules-amd/imports-mixing/expected.js @@ -3,4 +3,4 @@ define(["exports", "foo"], function (exports, _foo) { var foo = _foo.default; var xyz = _foo.baz; -}); +}); \ No newline at end of file diff --git a/test/fixtures/transformation/modules-amd/imports-named/expected.js b/test/fixtures/transformation/modules-amd/imports-named/expected.js index 5a8e29831e..5140508011 100644 --- a/test/fixtures/transformation/modules-amd/imports-named/expected.js +++ b/test/fixtures/transformation/modules-amd/imports-named/expected.js @@ -7,4 +7,4 @@ define(["exports", "foo"], function (exports, _foo) { var baz = _foo.bar; var baz = _foo.bar; var xyz = _foo.xyz; -}); +}); \ No newline at end of file diff --git a/test/fixtures/transformation/modules-amd/overview/expected.js b/test/fixtures/transformation/modules-amd/overview/expected.js index 48f4c57715..1ef8ac9dd3 100644 --- a/test/fixtures/transformation/modules-amd/overview/expected.js +++ b/test/fixtures/transformation/modules-amd/overview/expected.js @@ -7,6 +7,7 @@ define(["exports", "foo", "foo-bar", "./directory/foo-bar"], function (exports, var bar = _foo.foo; exports.test = test; var test = 5; + exports.test = test; exports.default = test; -}); +}); \ No newline at end of file diff --git a/test/fixtures/transformation/modules-common/exports-default/actual.js b/test/fixtures/transformation/modules-common/exports-default/actual.js index d7c96201d6..62923e5c15 100644 --- a/test/fixtures/transformation/modules-common/exports-default/actual.js +++ b/test/fixtures/transformation/modules-common/exports-default/actual.js @@ -5,4 +5,4 @@ export default foo; export default function () {} export default class {} export default function foo () {} -export default class foo {} +export default class Foo {} diff --git a/test/fixtures/transformation/modules-common/exports-default/expected.js b/test/fixtures/transformation/modules-common/exports-default/expected.js index a3a7f93464..ae98bf0118 100644 --- a/test/fixtures/transformation/modules-common/exports-default/expected.js +++ b/test/fixtures/transformation/modules-common/exports-default/expected.js @@ -1,12 +1,13 @@ "use strict"; + exports.default = 42; exports.default = {}; exports.default = []; exports.default = foo; -exports.default = function() {}; +exports.default = function () {}; +exports.default = function () {}; +function foo() {} +exports.default = foo; +function Foo() {} -exports.default = function() {}; - -exports.default = function foo() {}; - -exports.default = function foo() {}; +exports.default = Foo; \ No newline at end of file diff --git a/test/fixtures/transformation/modules-common/exports-from/expected.js b/test/fixtures/transformation/modules-common/exports-from/expected.js index 07ad61582b..72c66ea2b0 100644 --- a/test/fixtures/transformation/modules-common/exports-from/expected.js +++ b/test/fixtures/transformation/modules-common/exports-from/expected.js @@ -1,6 +1,6 @@ "use strict"; -(function(obj) { +(function (obj) { for (var i in obj) { exports[i] = obj[i]; } @@ -12,4 +12,4 @@ exports.bar = require("foo").bar; exports.bar = require("foo").foo; exports.default = require("foo").foo; exports.default = require("foo").foo; -exports.bar = require("foo").bar; +exports.bar = require("foo").bar; \ No newline at end of file diff --git a/test/fixtures/transformation/modules-common/exports-named/expected.js b/test/fixtures/transformation/modules-common/exports-named/expected.js index 045d242f69..cbd0686693 100644 --- a/test/fixtures/transformation/modules-common/exports-named/expected.js +++ b/test/fixtures/transformation/modules-common/exports-named/expected.js @@ -1,4 +1,5 @@ "use strict"; + exports.foo = foo; exports.foo = foo; exports.bar = bar; diff --git a/test/fixtures/transformation/modules-common/exports-variable/expected.js b/test/fixtures/transformation/modules-common/exports-variable/expected.js index e46d8ef9ef..13891af00d 100644 --- a/test/fixtures/transformation/modules-common/exports-variable/expected.js +++ b/test/fixtures/transformation/modules-common/exports-variable/expected.js @@ -1,8 +1,9 @@ "use strict"; + exports.foo7 = foo7; var foo = 1; exports.foo = foo; -var foo2 = function() {}; +var foo2 = function () {}; exports.foo2 = foo2; var foo3; exports.foo3 = foo3; @@ -13,7 +14,6 @@ exports.foo5 = _foo5; var _foo6 = 3; exports.foo6 = _foo6; function foo7() {} - var foo8 = function foo8() {}; -exports.foo8 = foo8; +exports.foo8 = foo8; \ No newline at end of file diff --git a/test/fixtures/transformation/modules-common/hoist-function-exports/actual.js b/test/fixtures/transformation/modules-common/hoist-function-exports/actual.js index aa0f9366ae..d0af5b7592 100644 --- a/test/fixtures/transformation/modules-common/hoist-function-exports/actual.js +++ b/test/fixtures/transformation/modules-common/hoist-function-exports/actual.js @@ -4,8 +4,8 @@ export function nextOdd(n) { return isEven(n) ? n + 1 : n + 2; } -export var isOdd = (function(isEven) { - return function(n) { +export var isOdd = (function (isEven) { + return function (n) { return !isEven(n); }; })(isEven); diff --git a/test/fixtures/transformation/modules-common/hoist-function-exports/expected.js b/test/fixtures/transformation/modules-common/hoist-function-exports/expected.js index 4eeae9f660..1c5aa19914 100644 --- a/test/fixtures/transformation/modules-common/hoist-function-exports/expected.js +++ b/test/fixtures/transformation/modules-common/hoist-function-exports/expected.js @@ -1,15 +1,14 @@ "use strict"; + exports.nextOdd = nextOdd; var isEven = require("./evens").isEven; - function nextOdd(n) { - return (isEven(n) ? n + 1 : n + 2); + return isEven(n) ? n + 1 : n + 2; } -var isOdd = function(isEven) { - return function(n) { +var isOdd = (function (isEven) { + return function (n) { return !isEven(n); }; -}(isEven); - +})(isEven); exports.isOdd = isOdd; \ No newline at end of file diff --git a/test/fixtures/transformation/modules-common/imports-default/expected.js b/test/fixtures/transformation/modules-common/imports-default/expected.js index 8543db200a..b91e38f915 100644 --- a/test/fixtures/transformation/modules-common/imports-default/expected.js +++ b/test/fixtures/transformation/modules-common/imports-default/expected.js @@ -1,3 +1,4 @@ "use strict"; + var foo = require("foo").default; var foo = require("foo").default; \ No newline at end of file diff --git a/test/fixtures/transformation/modules-common/imports-glob/expected.js b/test/fixtures/transformation/modules-common/imports-glob/expected.js index eaa887c8f8..e8c2d94a6a 100644 --- a/test/fixtures/transformation/modules-common/imports-glob/expected.js +++ b/test/fixtures/transformation/modules-common/imports-glob/expected.js @@ -1,2 +1,3 @@ "use strict"; + var foo = require("foo"); \ No newline at end of file diff --git a/test/fixtures/transformation/modules-common/imports-mixing/expected.js b/test/fixtures/transformation/modules-common/imports-mixing/expected.js index 218dbc26f0..6067d90d2b 100644 --- a/test/fixtures/transformation/modules-common/imports-mixing/expected.js +++ b/test/fixtures/transformation/modules-common/imports-mixing/expected.js @@ -1,3 +1,4 @@ "use strict"; + var foo = require("foo").default; -var xyz = require("foo").baz; +var xyz = require("foo").baz; \ No newline at end of file diff --git a/test/fixtures/transformation/modules-common/imports-named/expected.js b/test/fixtures/transformation/modules-common/imports-named/expected.js index 722dfd73aa..ed81790165 100644 --- a/test/fixtures/transformation/modules-common/imports-named/expected.js +++ b/test/fixtures/transformation/modules-common/imports-named/expected.js @@ -1,4 +1,5 @@ "use strict"; + var bar = require("foo").bar; var bar = require("foo").bar; var baz = require("foo").baz; diff --git a/test/fixtures/transformation/modules-common/imports/expected.js b/test/fixtures/transformation/modules-common/imports/expected.js index a1d960e91f..2c7c1b2e87 100644 --- a/test/fixtures/transformation/modules-common/imports/expected.js +++ b/test/fixtures/transformation/modules-common/imports/expected.js @@ -1,4 +1,7 @@ "use strict"; + require("foo"); + require("foo-bar"); + require("./directory/foo-bar"); \ No newline at end of file diff --git a/test/fixtures/transformation/modules-common/overview/expected.js b/test/fixtures/transformation/modules-common/overview/expected.js index 1aeb6bfa36..963c3278c3 100644 --- a/test/fixtures/transformation/modules-common/overview/expected.js +++ b/test/fixtures/transformation/modules-common/overview/expected.js @@ -1,12 +1,17 @@ "use strict"; + require("foo"); + require("foo-bar"); + require("./directory/foo-bar"); + var foo = require("foo").default; var foo = require("foo"); var bar = require("foo").bar; var bar = require("foo").foo; exports.test = test; var test = 5; + exports.test = test; exports.default = test; \ No newline at end of file diff --git a/test/fixtures/transformation/modules-umd/exports-default/actual.js b/test/fixtures/transformation/modules-umd/exports-default/actual.js index d7c96201d6..62923e5c15 100644 --- a/test/fixtures/transformation/modules-umd/exports-default/actual.js +++ b/test/fixtures/transformation/modules-umd/exports-default/actual.js @@ -5,4 +5,4 @@ export default foo; export default function () {} export default class {} export default function foo () {} -export default class foo {} +export default class Foo {} diff --git a/test/fixtures/transformation/modules-umd/exports-default/expected.js b/test/fixtures/transformation/modules-umd/exports-default/expected.js index 1558d65e8e..a666a52746 100644 --- a/test/fixtures/transformation/modules-umd/exports-default/expected.js +++ b/test/fixtures/transformation/modules-umd/exports-default/expected.js @@ -11,11 +11,11 @@ exports.default = {}; exports.default = []; exports.default = foo; - exports.default = function() {}; + exports.default = function () {}; + exports.default = function () {}; + function foo() {} + exports.default = foo; + function Foo() {} - exports.default = function() {}; - - exports.default = function foo() {}; - - exports.default = function foo() {}; -}); + exports.default = Foo; +}); \ No newline at end of file diff --git a/test/fixtures/transformation/modules-umd/exports-from/expected.js b/test/fixtures/transformation/modules-umd/exports-from/expected.js index 56b1a7561e..a181d838a9 100644 --- a/test/fixtures/transformation/modules-umd/exports-from/expected.js +++ b/test/fixtures/transformation/modules-umd/exports-from/expected.js @@ -7,7 +7,7 @@ })(function (exports, _foo) { "use strict"; - (function(obj) { + (function (obj) { for (var i in obj) { exports[i] = obj[i]; } @@ -20,4 +20,4 @@ exports.default = _foo.foo; exports.default = _foo.foo; exports.bar = _foo.bar; -}); +}); \ No newline at end of file diff --git a/test/fixtures/transformation/modules-umd/exports-named/expected.js b/test/fixtures/transformation/modules-umd/exports-named/expected.js index d8a3a136eb..b44a502794 100644 --- a/test/fixtures/transformation/modules-umd/exports-named/expected.js +++ b/test/fixtures/transformation/modules-umd/exports-named/expected.js @@ -14,4 +14,4 @@ exports.default = foo; exports.default = foo; exports.bar = bar; -}); +}); \ No newline at end of file diff --git a/test/fixtures/transformation/modules-umd/exports-variable/expected.js b/test/fixtures/transformation/modules-umd/exports-variable/expected.js index 307b548bc6..d77b71490c 100644 --- a/test/fixtures/transformation/modules-umd/exports-variable/expected.js +++ b/test/fixtures/transformation/modules-umd/exports-variable/expected.js @@ -10,7 +10,7 @@ exports.foo7 = foo7; var foo = 1; exports.foo = foo; - var foo2 = function() {}; + var foo2 = function () {}; exports.foo2 = foo2; var foo3; exports.foo3 = foo3; @@ -21,8 +21,7 @@ var _foo6 = 3; exports.foo6 = _foo6; function foo7() {} - var foo8 = function foo8() {}; exports.foo8 = foo8; -}); +}); \ No newline at end of file diff --git a/test/fixtures/transformation/modules-umd/hoist-function-exports/actual.js b/test/fixtures/transformation/modules-umd/hoist-function-exports/actual.js index aa0f9366ae..d0af5b7592 100644 --- a/test/fixtures/transformation/modules-umd/hoist-function-exports/actual.js +++ b/test/fixtures/transformation/modules-umd/hoist-function-exports/actual.js @@ -4,8 +4,8 @@ export function nextOdd(n) { return isEven(n) ? n + 1 : n + 2; } -export var isOdd = (function(isEven) { - return function(n) { +export var isOdd = (function (isEven) { + return function (n) { return !isEven(n); }; })(isEven); diff --git a/test/fixtures/transformation/modules-umd/hoist-function-exports/expected.js b/test/fixtures/transformation/modules-umd/hoist-function-exports/expected.js index c9afc83ea8..3543c04818 100644 --- a/test/fixtures/transformation/modules-umd/hoist-function-exports/expected.js +++ b/test/fixtures/transformation/modules-umd/hoist-function-exports/expected.js @@ -9,16 +9,14 @@ exports.nextOdd = nextOdd; var isEven = _evens.isEven; - function nextOdd(n) { - return (isEven(n) ? n + 1 : n + 2); + return isEven(n) ? n + 1 : n + 2; } - var isOdd = function(isEven) { - return function(n) { + var isOdd = (function (isEven) { + return function (n) { return !isEven(n); }; - }(isEven); - + })(isEven); exports.isOdd = isOdd; -}); +}); \ No newline at end of file diff --git a/test/fixtures/transformation/modules-umd/imports-default/expected.js b/test/fixtures/transformation/modules-umd/imports-default/expected.js index 1b3a501cbc..7937c70061 100644 --- a/test/fixtures/transformation/modules-umd/imports-default/expected.js +++ b/test/fixtures/transformation/modules-umd/imports-default/expected.js @@ -9,4 +9,4 @@ var foo = _foo.default; var foo = _foo.default; -}); +}); \ No newline at end of file diff --git a/test/fixtures/transformation/modules-umd/imports-glob/expected.js b/test/fixtures/transformation/modules-umd/imports-glob/expected.js index 4a07639cde..45a763f2f2 100644 --- a/test/fixtures/transformation/modules-umd/imports-glob/expected.js +++ b/test/fixtures/transformation/modules-umd/imports-glob/expected.js @@ -6,5 +6,6 @@ } })(function (exports, _foo) { "use strict"; + var foo = _foo; -}); +}); \ No newline at end of file diff --git a/test/fixtures/transformation/modules-umd/imports-mixing/expected.js b/test/fixtures/transformation/modules-umd/imports-mixing/expected.js index 4dd5c7b377..42e39a9022 100644 --- a/test/fixtures/transformation/modules-umd/imports-mixing/expected.js +++ b/test/fixtures/transformation/modules-umd/imports-mixing/expected.js @@ -6,6 +6,7 @@ } })(function (exports, _foo) { "use strict"; + var foo = _foo.default; var xyz = _foo.baz; -}); +}); \ No newline at end of file diff --git a/test/fixtures/transformation/modules-umd/imports-named/expected.js b/test/fixtures/transformation/modules-umd/imports-named/expected.js index a2bca67e08..2d75892bf6 100644 --- a/test/fixtures/transformation/modules-umd/imports-named/expected.js +++ b/test/fixtures/transformation/modules-umd/imports-named/expected.js @@ -6,10 +6,11 @@ } })(function (exports, _foo) { "use strict"; + var bar = _foo.bar; var bar = _foo.bar; var baz = _foo.baz; var baz = _foo.bar; var baz = _foo.bar; var xyz = _foo.xyz; -}); +}); \ No newline at end of file diff --git a/test/fixtures/transformation/modules-umd/overview/expected.js b/test/fixtures/transformation/modules-umd/overview/expected.js index 6c539683dc..931d12fcf0 100644 --- a/test/fixtures/transformation/modules-umd/overview/expected.js +++ b/test/fixtures/transformation/modules-umd/overview/expected.js @@ -6,12 +6,14 @@ } })(function (exports, _foo, _fooBar, _directoryFooBar) { "use strict"; + var foo = _foo.default; var foo = _foo; var bar = _foo.bar; var bar = _foo.foo; exports.test = test; var test = 5; + exports.test = test; exports.default = test; -}); +}); \ No newline at end of file diff --git a/test/fixtures/transformation/property-methods-assignment/getter-and-setter/expected.js b/test/fixtures/transformation/property-methods-assignment/getter-and-setter/expected.js index c357ad0496..ae8adf0c9a 100644 --- a/test/fixtures/transformation/property-methods-assignment/getter-and-setter/expected.js +++ b/test/fixtures/transformation/property-methods-assignment/getter-and-setter/expected.js @@ -1,17 +1,14 @@ "use strict"; -var obj = function(_obj) { - Object.defineProperties(_obj, { - foo: { - get: function() { - return 5 + 5; - }, - - set: function(value) { - this._foo = value; - } +var obj = (function (_obj) { + Object.defineProperties(_obj, { foo: { + get: function () { + return 5 + 5; + }, + set: function (value) { + this._foo = value; } - }); + } }); return _obj; -}({}); \ No newline at end of file +})({}); \ No newline at end of file diff --git a/test/fixtures/transformation/property-methods-assignment/getter/expected.js b/test/fixtures/transformation/property-methods-assignment/getter/expected.js index 9a00ceb9ec..1691441c02 100644 --- a/test/fixtures/transformation/property-methods-assignment/getter/expected.js +++ b/test/fixtures/transformation/property-methods-assignment/getter/expected.js @@ -1,13 +1,9 @@ "use strict"; -var obj = function(_obj) { - Object.defineProperties(_obj, { - foo: { - get: function() { - return 5 + 5; - } - } - }); +var obj = (function (_obj) { + Object.defineProperties(_obj, { foo: { get: function () { + return 5 + 5; + } } }); return _obj; -}({}); \ No newline at end of file +})({}); \ No newline at end of file diff --git a/test/fixtures/transformation/property-methods-assignment/method/expected.js b/test/fixtures/transformation/property-methods-assignment/method/expected.js index a78e3e92d8..d70e8989ac 100644 --- a/test/fixtures/transformation/property-methods-assignment/method/expected.js +++ b/test/fixtures/transformation/property-methods-assignment/method/expected.js @@ -1,7 +1,5 @@ "use strict"; -var obj = { - method: function() { - return 5 + 5; - } -}; \ No newline at end of file +var obj = { method: function () { + return 5 + 5; +} }; \ No newline at end of file diff --git a/test/fixtures/transformation/property-methods-assignment/setter/expected.js b/test/fixtures/transformation/property-methods-assignment/setter/expected.js index 843982efa2..f3ee6caefc 100644 --- a/test/fixtures/transformation/property-methods-assignment/setter/expected.js +++ b/test/fixtures/transformation/property-methods-assignment/setter/expected.js @@ -1,13 +1,9 @@ "use strict"; -var obj = function(_obj) { - Object.defineProperties(_obj, { - foo: { - set: function(value) { - this._foo = value; - } - } - }); +var obj = (function (_obj) { + Object.defineProperties(_obj, { foo: { set: function (value) { + this._foo = value; + } } }); return _obj; -}({}); \ No newline at end of file +})({}); \ No newline at end of file diff --git a/test/fixtures/transformation/property-name-shorthand/single/expected.js b/test/fixtures/transformation/property-name-shorthand/single/expected.js index c8d904ff0e..d0bd0eaa68 100644 --- a/test/fixtures/transformation/property-name-shorthand/single/expected.js +++ b/test/fixtures/transformation/property-name-shorthand/single/expected.js @@ -1,5 +1,3 @@ "use strict"; -var coords = { - x: x -}; \ No newline at end of file +var coords = { x: x }; \ No newline at end of file diff --git a/test/fixtures/transformation/react/display-name-assignment-expression/actual.js b/test/fixtures/transformation/react/display-name-assignment-expression/actual.js index f3affde052..7a91ae99d3 100644 --- a/test/fixtures/transformation/react/display-name-assignment-expression/actual.js +++ b/test/fixtures/transformation/react/display-name-assignment-expression/actual.js @@ -1,6 +1,6 @@ var Component; Component = React.createClass({ - render: function() { + render: function () { return null; } }); diff --git a/test/fixtures/transformation/react/display-name-assignment-expression/expected.js b/test/fixtures/transformation/react/display-name-assignment-expression/expected.js index 0096748e3d..6d69f27a7a 100644 --- a/test/fixtures/transformation/react/display-name-assignment-expression/expected.js +++ b/test/fixtures/transformation/react/display-name-assignment-expression/expected.js @@ -1,10 +1,9 @@ "use strict"; -var Component; +var Component; Component = React.createClass({ displayName: "Component", - - render: function() { + render: function () { return null; } }); \ No newline at end of file diff --git a/test/fixtures/transformation/react/display-name-if-missing/actual.js b/test/fixtures/transformation/react/display-name-if-missing/actual.js index 4232881d66..501a447782 100644 --- a/test/fixtures/transformation/react/display-name-if-missing/actual.js +++ b/test/fixtures/transformation/react/display-name-if-missing/actual.js @@ -1,6 +1,6 @@ var Whateva = React.createClass({ displayName: "Whatever", - render: function() { + render: function () { return null; } }); diff --git a/test/fixtures/transformation/react/display-name-if-missing/expected.js b/test/fixtures/transformation/react/display-name-if-missing/expected.js index e802413800..2ef17aa97c 100644 --- a/test/fixtures/transformation/react/display-name-if-missing/expected.js +++ b/test/fixtures/transformation/react/display-name-if-missing/expected.js @@ -2,8 +2,7 @@ var Whateva = React.createClass({ displayName: "Whatever", - - render: function() { + render: function () { return null; } }); \ No newline at end of file diff --git a/test/fixtures/transformation/react/display-name-object-declaration/actual.js b/test/fixtures/transformation/react/display-name-object-declaration/actual.js index 51a000a533..b00fb85bde 100644 --- a/test/fixtures/transformation/react/display-name-object-declaration/actual.js +++ b/test/fixtures/transformation/react/display-name-object-declaration/actual.js @@ -1,6 +1,6 @@ exports = { Component: React.createClass({ - render: function() { + render: function () { return null; } }) diff --git a/test/fixtures/transformation/react/display-name-object-declaration/expected.js b/test/fixtures/transformation/react/display-name-object-declaration/expected.js index cde3afa785..6986b8ba92 100644 --- a/test/fixtures/transformation/react/display-name-object-declaration/expected.js +++ b/test/fixtures/transformation/react/display-name-object-declaration/expected.js @@ -1,11 +1,8 @@ "use strict"; -exports = { - Component: React.createClass({ - displayName: "Component", - - render: function() { - return null; - } - }) -}; \ No newline at end of file +exports = { Component: React.createClass({ + displayName: "Component", + render: function () { + return null; + } +}) }; \ No newline at end of file diff --git a/test/fixtures/transformation/react/display-name-property-assignment/actual.js b/test/fixtures/transformation/react/display-name-property-assignment/actual.js index f856d33f07..88f7a1df11 100644 --- a/test/fixtures/transformation/react/display-name-property-assignment/actual.js +++ b/test/fixtures/transformation/react/display-name-property-assignment/actual.js @@ -1,5 +1,5 @@ exports.Component = React.createClass({ - render: function() { + render: function () { return null; } }); diff --git a/test/fixtures/transformation/react/display-name-property-assignment/expected.js b/test/fixtures/transformation/react/display-name-property-assignment/expected.js index ca445b30a1..e174173e41 100644 --- a/test/fixtures/transformation/react/display-name-property-assignment/expected.js +++ b/test/fixtures/transformation/react/display-name-property-assignment/expected.js @@ -2,8 +2,7 @@ exports.Component = React.createClass({ displayName: "Component", - - render: function() { + render: function () { return null; } }); \ No newline at end of file diff --git a/test/fixtures/transformation/react/display-name-variable-declaration/actual.js b/test/fixtures/transformation/react/display-name-variable-declaration/actual.js index e751186def..e352fe5706 100644 --- a/test/fixtures/transformation/react/display-name-variable-declaration/actual.js +++ b/test/fixtures/transformation/react/display-name-variable-declaration/actual.js @@ -1,5 +1,5 @@ var Component = React.createClass({ - render: function() { + render: function () { return null; } }); diff --git a/test/fixtures/transformation/react/display-name-variable-declaration/expected.js b/test/fixtures/transformation/react/display-name-variable-declaration/expected.js index 60d186b8dd..505d82ae8b 100644 --- a/test/fixtures/transformation/react/display-name-variable-declaration/expected.js +++ b/test/fixtures/transformation/react/display-name-variable-declaration/expected.js @@ -2,8 +2,7 @@ var Component = React.createClass({ displayName: "Component", - - render: function() { + render: function () { return null; } }); \ No newline at end of file diff --git a/test/fixtures/transformation/rest-parameters/arrow-functions/expected.js b/test/fixtures/transformation/rest-parameters/arrow-functions/expected.js index ede93ea6e7..641879f5cf 100644 --- a/test/fixtures/transformation/rest-parameters/arrow-functions/expected.js +++ b/test/fixtures/transformation/rest-parameters/arrow-functions/expected.js @@ -1,5 +1,6 @@ "use strict"; + var _slice = Array.prototype.slice; var concat = function () { var arrs = _slice.call(arguments); -}; +}; \ No newline at end of file diff --git a/test/fixtures/transformation/rest-parameters/multiple/expected.js b/test/fixtures/transformation/rest-parameters/multiple/expected.js index b9f8d1687b..70f87316c0 100644 --- a/test/fixtures/transformation/rest-parameters/multiple/expected.js +++ b/test/fixtures/transformation/rest-parameters/multiple/expected.js @@ -1,7 +1,7 @@ "use strict"; -var _slice = Array.prototype.slice; -var t = function(f) { +var _slice = Array.prototype.slice; +var t = function (f) { var items = _slice.call(arguments, 1); }; diff --git a/test/fixtures/transformation/rest-parameters/single/expected.js b/test/fixtures/transformation/rest-parameters/single/expected.js index d45c7f4c40..ef6466c8b0 100644 --- a/test/fixtures/transformation/rest-parameters/single/expected.js +++ b/test/fixtures/transformation/rest-parameters/single/expected.js @@ -1,7 +1,7 @@ "use strict"; -var _slice = Array.prototype.slice; -var t = function() { +var _slice = Array.prototype.slice; +var t = function () { var items = _slice.call(arguments); }; diff --git a/test/fixtures/transformation/source-maps/arrow-function/expected.js b/test/fixtures/transformation/source-maps/arrow-function/expected.js index d39e2afebe..2974ebc2a4 100644 --- a/test/fixtures/transformation/source-maps/arrow-function/expected.js +++ b/test/fixtures/transformation/source-maps/arrow-function/expected.js @@ -1,4 +1,5 @@ "use strict"; -var t = function(x) { + +var t = function (x) { return x * x; -}; +}; \ No newline at end of file diff --git a/test/fixtures/transformation/source-maps/arrow-function/source-mappings.json b/test/fixtures/transformation/source-maps/arrow-function/source-mappings.json index 02a7a17ee3..d6c4b7d064 100644 --- a/test/fixtures/transformation/source-maps/arrow-function/source-mappings.json +++ b/test/fixtures/transformation/source-maps/arrow-function/source-mappings.json @@ -4,7 +4,7 @@ "column": 18 }, "generated": { - "line": 3, + "line": 4, "column": 14 } }] diff --git a/test/fixtures/transformation/source-maps/class/expected.js b/test/fixtures/transformation/source-maps/class/expected.js index 0706f1a8d6..1c7c0b2d2f 100644 --- a/test/fixtures/transformation/source-maps/class/expected.js +++ b/test/fixtures/transformation/source-maps/class/expected.js @@ -1,14 +1,19 @@ "use strict"; + var _classProps = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; + var Test = (function () { var Test = function Test() {}; + _classProps(Test, null, { bar: { get: function () { throw new Error("wow"); } } }); + return Test; })(); + var test = new Test; -test.bar; +test.bar; \ No newline at end of file diff --git a/test/fixtures/transformation/source-maps/class/source-mappings.json b/test/fixtures/transformation/source-maps/class/source-mappings.json index 9632b0c4eb..594ce68ed8 100644 --- a/test/fixtures/transformation/source-maps/class/source-mappings.json +++ b/test/fixtures/transformation/source-maps/class/source-mappings.json @@ -4,7 +4,7 @@ "column": 11 }, "generated": { - "line": 9, + "line": 12, "column": 11 } }] diff --git a/test/fixtures/transformation/source-maps/full/expected.js b/test/fixtures/transformation/source-maps/full/expected.js index 9691f5dcbf..b38b216584 100644 --- a/test/fixtures/transformation/source-maps/full/expected.js +++ b/test/fixtures/transformation/source-maps/full/expected.js @@ -1,5 +1,5 @@ "use strict"; -arr.map(function(x) { +arr.map(function (x) { return x * x; }); \ No newline at end of file diff --git a/test/fixtures/transformation/source-maps/inline/expected.js b/test/fixtures/transformation/source-maps/inline/expected.js index 9691f5dcbf..e136af8d90 100644 --- a/test/fixtures/transformation/source-maps/inline/expected.js +++ b/test/fixtures/transformation/source-maps/inline/expected.js @@ -1,5 +1,5 @@ "use strict"; -arr.map(function(x) { +arr.map(function (x) { return x * x; -}); \ No newline at end of file +}); diff --git a/test/fixtures/transformation/spread/arguments/expected.js b/test/fixtures/transformation/spread/arguments/expected.js index 18080d5978..7b910095cf 100644 --- a/test/fixtures/transformation/spread/arguments/expected.js +++ b/test/fixtures/transformation/spread/arguments/expected.js @@ -1,6 +1,6 @@ "use strict"; -var _slice = Array.prototype.slice; +var _slice = Array.prototype.slice; function foo() { return bar.apply(null, ["test"].concat(_slice.call(arguments))); } diff --git a/test/fixtures/transformation/spread/array-literal-first/expected.js b/test/fixtures/transformation/spread/array-literal-first/expected.js index ef93019076..92ba7217fa 100644 --- a/test/fixtures/transformation/spread/array-literal-first/expected.js +++ b/test/fixtures/transformation/spread/array-literal-first/expected.js @@ -1,3 +1,4 @@ "use strict"; + var _slice = Array.prototype.slice; -var lyrics = _slice.call(parts).concat(["head", "and", "toes"]); +var lyrics = _slice.call(parts).concat(["head", "and", "toes"]); \ No newline at end of file diff --git a/test/fixtures/transformation/spread/array-literal-middle/expected.js b/test/fixtures/transformation/spread/array-literal-middle/expected.js index 70e1aef3cc..a7085e299e 100644 --- a/test/fixtures/transformation/spread/array-literal-middle/expected.js +++ b/test/fixtures/transformation/spread/array-literal-middle/expected.js @@ -1,3 +1,4 @@ "use strict"; + var _slice = Array.prototype.slice; -var a = [b].concat(_slice.call(c), [d]); +var a = [b].concat(_slice.call(c), [d]); \ No newline at end of file diff --git a/test/fixtures/transformation/spread/array-literal-multiple/expected.js b/test/fixtures/transformation/spread/array-literal-multiple/expected.js index 4e9bc9f415..281faa0a0b 100644 --- a/test/fixtures/transformation/spread/array-literal-multiple/expected.js +++ b/test/fixtures/transformation/spread/array-literal-multiple/expected.js @@ -1,3 +1,4 @@ "use strict"; + var _slice = Array.prototype.slice; -var a = [b].concat(_slice.call(c), [d, e], _slice.call(f)); +var a = [b].concat(_slice.call(c), [d, e], _slice.call(f)); \ No newline at end of file diff --git a/test/fixtures/transformation/spread/array-literals/expected.js b/test/fixtures/transformation/spread/array-literals/expected.js index 4cc07d91a9..306c74e11e 100644 --- a/test/fixtures/transformation/spread/array-literals/expected.js +++ b/test/fixtures/transformation/spread/array-literals/expected.js @@ -1,3 +1,4 @@ "use strict"; + var _slice = Array.prototype.slice; var lyrics = ["head", "and", "toes"].concat(_slice.call(parts)); \ No newline at end of file diff --git a/test/fixtures/transformation/spread/contexted-computed-method-call-multiple-args/expected.js b/test/fixtures/transformation/spread/contexted-computed-method-call-multiple-args/expected.js index 1d5363f0d0..b169ad461e 100644 --- a/test/fixtures/transformation/spread/contexted-computed-method-call-multiple-args/expected.js +++ b/test/fixtures/transformation/spread/contexted-computed-method-call-multiple-args/expected.js @@ -1,3 +1,4 @@ "use strict"; + var _slice = Array.prototype.slice; -obj[method].apply(obj, [foo, bar].concat(_slice.call(args))); +obj[method].apply(obj, [foo, bar].concat(_slice.call(args))); \ No newline at end of file diff --git a/test/fixtures/transformation/spread/contexted-computed-method-call-single-arg/expected.js b/test/fixtures/transformation/spread/contexted-computed-method-call-single-arg/expected.js index ced58a87d6..1baae55982 100644 --- a/test/fixtures/transformation/spread/contexted-computed-method-call-single-arg/expected.js +++ b/test/fixtures/transformation/spread/contexted-computed-method-call-single-arg/expected.js @@ -1,3 +1,4 @@ "use strict"; + var _slice = Array.prototype.slice; -obj[method].apply(obj, _slice.call(args)); +obj[method].apply(obj, _slice.call(args)); \ No newline at end of file diff --git a/test/fixtures/transformation/spread/contexted-method-call-multiple-args/expected.js b/test/fixtures/transformation/spread/contexted-method-call-multiple-args/expected.js index 860638d174..cda8769889 100644 --- a/test/fixtures/transformation/spread/contexted-method-call-multiple-args/expected.js +++ b/test/fixtures/transformation/spread/contexted-method-call-multiple-args/expected.js @@ -1,4 +1,5 @@ "use strict"; + var _slice = Array.prototype.slice; foob.add.apply(foob, [foo, bar].concat(_slice.call(numbers))); foob.test.add.apply(foob.test, [foo, bar].concat(_slice.call(numbers))); \ No newline at end of file diff --git a/test/fixtures/transformation/spread/contexted-method-call-single-arg/expected.js b/test/fixtures/transformation/spread/contexted-method-call-single-arg/expected.js index d2a488b1fe..9d0c650a61 100644 --- a/test/fixtures/transformation/spread/contexted-method-call-single-arg/expected.js +++ b/test/fixtures/transformation/spread/contexted-method-call-single-arg/expected.js @@ -1,4 +1,5 @@ "use strict"; + var _slice = Array.prototype.slice; foob.add.apply(foob, _slice.call(numbers)); foob.test.add.apply(foob.test, _slice.call(numbers)); \ No newline at end of file diff --git a/test/fixtures/transformation/spread/method-call-array-literal/expected.js b/test/fixtures/transformation/spread/method-call-array-literal/expected.js index 8824a0d8eb..fb0bae3ea8 100644 --- a/test/fixtures/transformation/spread/method-call-array-literal/expected.js +++ b/test/fixtures/transformation/spread/method-call-array-literal/expected.js @@ -1,2 +1,3 @@ "use strict"; + f.apply(null, [1, 2, 3]); \ No newline at end of file diff --git a/test/fixtures/transformation/spread/method-call-first/expected.js b/test/fixtures/transformation/spread/method-call-first/expected.js index 82d56c4065..45b93b3cc8 100644 --- a/test/fixtures/transformation/spread/method-call-first/expected.js +++ b/test/fixtures/transformation/spread/method-call-first/expected.js @@ -1,3 +1,4 @@ "use strict"; + var _slice = Array.prototype.slice; -add.apply(null, _slice.call(numbers).concat([foo, bar])); +add.apply(null, _slice.call(numbers).concat([foo, bar])); \ No newline at end of file diff --git a/test/fixtures/transformation/spread/method-call-middle/expected.js b/test/fixtures/transformation/spread/method-call-middle/expected.js index 16b1508097..9df2185466 100644 --- a/test/fixtures/transformation/spread/method-call-middle/expected.js +++ b/test/fixtures/transformation/spread/method-call-middle/expected.js @@ -1,3 +1,4 @@ "use strict"; + var _slice = Array.prototype.slice; -add.apply(null, [foo].concat(_slice.call(numbers), [bar])); +add.apply(null, [foo].concat(_slice.call(numbers), [bar])); \ No newline at end of file diff --git a/test/fixtures/transformation/spread/method-call-multiple-args/expected.js b/test/fixtures/transformation/spread/method-call-multiple-args/expected.js index 5ae73e4362..7f0b028cd9 100644 --- a/test/fixtures/transformation/spread/method-call-multiple-args/expected.js +++ b/test/fixtures/transformation/spread/method-call-multiple-args/expected.js @@ -1,3 +1,4 @@ "use strict"; + var _slice = Array.prototype.slice; add.apply(null, [foo, bar].concat(_slice.call(numbers))); \ No newline at end of file diff --git a/test/fixtures/transformation/spread/method-call-multiple/expected.js b/test/fixtures/transformation/spread/method-call-multiple/expected.js index 69096bc7bd..a340d3c2f6 100644 --- a/test/fixtures/transformation/spread/method-call-multiple/expected.js +++ b/test/fixtures/transformation/spread/method-call-multiple/expected.js @@ -1,3 +1,4 @@ "use strict"; + var _slice = Array.prototype.slice; -add.apply(null, [foo].concat(_slice.call(numbers), [bar, what], _slice.call(test))); +add.apply(null, [foo].concat(_slice.call(numbers), [bar, what], _slice.call(test))); \ No newline at end of file diff --git a/test/fixtures/transformation/spread/method-call-single-arg/expected.js b/test/fixtures/transformation/spread/method-call-single-arg/expected.js index 391b08d8c7..d0c52b6d23 100644 --- a/test/fixtures/transformation/spread/method-call-single-arg/expected.js +++ b/test/fixtures/transformation/spread/method-call-single-arg/expected.js @@ -1,3 +1,4 @@ "use strict"; + var _slice = Array.prototype.slice; add.apply(null, _slice.call(numbers)); \ No newline at end of file diff --git a/test/fixtures/transformation/template-literals/escape-quotes/expected.js b/test/fixtures/transformation/template-literals/escape-quotes/expected.js index 7d90c09a11..57381d318b 100644 --- a/test/fixtures/transformation/template-literals/escape-quotes/expected.js +++ b/test/fixtures/transformation/template-literals/escape-quotes/expected.js @@ -1,2 +1,3 @@ "use strict"; + var t = "'" + foo + "' \"" + bar + "\""; \ No newline at end of file diff --git a/test/fixtures/transformation/template-literals/functions/expected.js b/test/fixtures/transformation/template-literals/functions/expected.js index acb11d17f2..70ce864f59 100644 --- a/test/fixtures/transformation/template-literals/functions/expected.js +++ b/test/fixtures/transformation/template-literals/functions/expected.js @@ -1,2 +1,3 @@ "use strict"; + var foo = "test " + _.test(foo) + " " + bar; \ No newline at end of file diff --git a/test/fixtures/transformation/template-literals/multiline/expected.js b/test/fixtures/transformation/template-literals/multiline/expected.js index d90ae15a5a..f8cfb32013 100644 --- a/test/fixtures/transformation/template-literals/multiline/expected.js +++ b/test/fixtures/transformation/template-literals/multiline/expected.js @@ -1,2 +1,3 @@ "use strict"; + var o = "wow\nthis is\nactually multiline!"; \ No newline at end of file diff --git a/test/fixtures/transformation/template-literals/multiple/expected.js b/test/fixtures/transformation/template-literals/multiple/expected.js index 1f39dda64e..8ebe48a409 100644 --- a/test/fixtures/transformation/template-literals/multiple/expected.js +++ b/test/fixtures/transformation/template-literals/multiple/expected.js @@ -1,2 +1,3 @@ "use strict"; + var foo = "test " + foo + " " + bar; \ No newline at end of file diff --git a/test/fixtures/transformation/template-literals/none/expected.js b/test/fixtures/transformation/template-literals/none/expected.js index 312ad1893b..5736960a49 100644 --- a/test/fixtures/transformation/template-literals/none/expected.js +++ b/test/fixtures/transformation/template-literals/none/expected.js @@ -1,2 +1,3 @@ "use strict"; + var foo = "test"; \ No newline at end of file diff --git a/test/fixtures/transformation/template-literals/only/expected.js b/test/fixtures/transformation/template-literals/only/expected.js index 8a26c6537b..4ab29f3954 100644 --- a/test/fixtures/transformation/template-literals/only/expected.js +++ b/test/fixtures/transformation/template-literals/only/expected.js @@ -1,2 +1,3 @@ "use strict"; + var foo = "" + test; \ No newline at end of file diff --git a/test/fixtures/transformation/template-literals/single/expected.js b/test/fixtures/transformation/template-literals/single/expected.js index d177f7c6a7..8e5c50be59 100644 --- a/test/fixtures/transformation/template-literals/single/expected.js +++ b/test/fixtures/transformation/template-literals/single/expected.js @@ -1,2 +1,3 @@ "use strict"; + var foo = "test " + foo; \ No newline at end of file diff --git a/test/fixtures/transformation/template-literals/statement/expected.js b/test/fixtures/transformation/template-literals/statement/expected.js index 6714f83af2..792d3806f3 100644 --- a/test/fixtures/transformation/template-literals/statement/expected.js +++ b/test/fixtures/transformation/template-literals/statement/expected.js @@ -1,2 +1,3 @@ "use strict"; + var foo = "test " + (foo + bar); \ No newline at end of file diff --git a/test/fixtures/transformation/template-literals/tag/expected.js b/test/fixtures/transformation/template-literals/tag/expected.js index a33273a08c..cff3164497 100644 --- a/test/fixtures/transformation/template-literals/tag/expected.js +++ b/test/fixtures/transformation/template-literals/tag/expected.js @@ -1,2 +1,3 @@ "use strict"; + var foo = bar(["a", "b ", ""], 42, _.foobar()); \ No newline at end of file diff --git a/test/fixtures/transformation/unicode-regex/basic/expected.js b/test/fixtures/transformation/unicode-regex/basic/expected.js index 130460934d..9a67fcdf95 100644 --- a/test/fixtures/transformation/unicode-regex/basic/expected.js +++ b/test/fixtures/transformation/unicode-regex/basic/expected.js @@ -1,6 +1,4 @@ "use strict"; -var string = "foo💩bar"; -var match = string.match( - /foo((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF]))bar/ -); \ No newline at end of file +var string = "foo💩bar"; +var match = string.match(/foo((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF]))bar/); \ No newline at end of file diff --git a/test/fixtures/transformation/unicode-regex/ignore-non-unicode/expected.js b/test/fixtures/transformation/unicode-regex/ignore-non-unicode/expected.js index 629ac66ff4..a24792c6e5 100644 --- a/test/fixtures/transformation/unicode-regex/ignore-non-unicode/expected.js +++ b/test/fixtures/transformation/unicode-regex/ignore-non-unicode/expected.js @@ -1,3 +1,4 @@ "use strict"; + var string = "foo💩bar"; var match = string.match(/foo(.)bar/); \ No newline at end of file diff --git a/test/fixtures/transformation/use-strict/add/expected.js b/test/fixtures/transformation/use-strict/add/expected.js index bcf0a73352..4afd33e9c5 100644 --- a/test/fixtures/transformation/use-strict/add/expected.js +++ b/test/fixtures/transformation/use-strict/add/expected.js @@ -1,2 +1,3 @@ "use strict"; + foo(); \ No newline at end of file diff --git a/test/fixtures/transformation/use-strict/exists/expected.js b/test/fixtures/transformation/use-strict/exists/expected.js index bcf0a73352..4afd33e9c5 100644 --- a/test/fixtures/transformation/use-strict/exists/expected.js +++ b/test/fixtures/transformation/use-strict/exists/expected.js @@ -1,2 +1,3 @@ "use strict"; + foo(); \ No newline at end of file