diff --git a/lib/6to5/generation/buffer.js b/lib/6to5/generation/buffer.js index 3a1bb303bf..3db36a65ad 100644 --- a/lib/6to5/generation/buffer.js +++ b/lib/6to5/generation/buffer.js @@ -68,7 +68,11 @@ Buffer.prototype.removeLast = function (cha) { }; Buffer.prototype.newline = function (i, removeLast) { - if (this.format.compact) return; + if (this.format.compact) { + this.space(); + return; + } + removeLast = removeLast || false; if (_.isNumber(i)) { diff --git a/test/fixtures/transformation/async-to-generator/expression/expected.js b/test/fixtures/transformation/async-to-generator/expression/expected.js index cb5f6a8c4c..b8acf98a48 100644 --- a/test/fixtures/transformation/async-to-generator/expression/expected.js +++ b/test/fixtures/transformation/async-to-generator/expression/expected.js @@ -1,36 +1,7 @@ "use strict"; -var _asyncToGenerator = function (fn) { - return function () { - var gen = fn.apply(this, arguments); - - return new Promise(function (resolve, reject) { - var callNext = step.bind(gen.next); - - var callThrow = step.bind(gen["throw"]); - - function step(arg) { - try { - var info = this(arg); - - var value = info.value; - } catch (error) { - reject(error); - - return; - } - if (info.done) { - resolve(value); - } else { - Promise.resolve(value).then(callNext, callThrow); - } - } - - callNext(); - }); - }; -}; +var _asyncToGenerator = function (fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { var callNext = step.bind(gen.next); var callThrow = step.bind(gen["throw"]); function step(arg) { try { var info = this(arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(callNext, callThrow); } } callNext(); }); }; }; var foo = _asyncToGenerator(function* () { var wat = yield bar(); -}); +}); \ No newline at end of file diff --git a/test/fixtures/transformation/async-to-generator/statement/expected.js b/test/fixtures/transformation/async-to-generator/statement/expected.js index cb5f6a8c4c..b8acf98a48 100644 --- a/test/fixtures/transformation/async-to-generator/statement/expected.js +++ b/test/fixtures/transformation/async-to-generator/statement/expected.js @@ -1,36 +1,7 @@ "use strict"; -var _asyncToGenerator = function (fn) { - return function () { - var gen = fn.apply(this, arguments); - - return new Promise(function (resolve, reject) { - var callNext = step.bind(gen.next); - - var callThrow = step.bind(gen["throw"]); - - function step(arg) { - try { - var info = this(arg); - - var value = info.value; - } catch (error) { - reject(error); - - return; - } - if (info.done) { - resolve(value); - } else { - Promise.resolve(value).then(callNext, callThrow); - } - } - - callNext(); - }); - }; -}; +var _asyncToGenerator = function (fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { var callNext = step.bind(gen.next); var callThrow = step.bind(gen["throw"]); function step(arg) { try { var info = this(arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(callNext, callThrow); } } callNext(); }); }; }; var foo = _asyncToGenerator(function* () { var wat = yield bar(); -}); +}); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-classes-loose/accessing-super-class/expected.js b/test/fixtures/transformation/es6-classes-loose/accessing-super-class/expected.js index da55553e8a..1aee2c69ea 100644 --- a/test/fixtures/transformation/es6-classes-loose/accessing-super-class/expected.js +++ b/test/fixtures/transformation/es6-classes-loose/accessing-super-class/expected.js @@ -1,20 +1,7 @@ "use strict"; var _slice = Array.prototype.slice; -var _inherits = function (subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - enumerable: false, - writable: true, - configurable: true - } - }); - if (superClass) subClass.__proto__ = superClass; -}; +var _inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }; var Test = (function (Foo) { function Test() { @@ -47,4 +34,4 @@ var Test = (function (Foo) { }; return Test; -})(Foo); +})(Foo); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-classes-loose/accessing-super-properties/expected.js b/test/fixtures/transformation/es6-classes-loose/accessing-super-properties/expected.js index ee1cfb3253..9847c19e45 100644 --- a/test/fixtures/transformation/es6-classes-loose/accessing-super-properties/expected.js +++ b/test/fixtures/transformation/es6-classes-loose/accessing-super-properties/expected.js @@ -1,19 +1,6 @@ "use strict"; -var _inherits = function (subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - enumerable: false, - writable: true, - configurable: true - } - }); - if (superClass) subClass.__proto__ = superClass; -}; +var _inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }; var Test = (function (Foo) { function Test() { @@ -24,4 +11,4 @@ var Test = (function (Foo) { _inherits(Test, Foo); return Test; -})(Foo); +})(Foo); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-classes-loose/calling-super-properties/expected.js b/test/fixtures/transformation/es6-classes-loose/calling-super-properties/expected.js index 065e6fc263..4caab68366 100644 --- a/test/fixtures/transformation/es6-classes-loose/calling-super-properties/expected.js +++ b/test/fixtures/transformation/es6-classes-loose/calling-super-properties/expected.js @@ -1,19 +1,6 @@ "use strict"; -var _inherits = function (subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - enumerable: false, - writable: true, - configurable: true - } - }); - if (superClass) subClass.__proto__ = superClass; -}; +var _inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }; var Test = (function (Foo) { function Test() { @@ -28,4 +15,4 @@ var Test = (function (Foo) { }; return Test; -})(Foo); +})(Foo); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-classes-loose/super-class-id-member-expression/expected.js b/test/fixtures/transformation/es6-classes-loose/super-class-id-member-expression/expected.js index f8b4bc49e2..708616d6a9 100644 --- a/test/fixtures/transformation/es6-classes-loose/super-class-id-member-expression/expected.js +++ b/test/fixtures/transformation/es6-classes-loose/super-class-id-member-expression/expected.js @@ -1,19 +1,6 @@ "use strict"; -var _inherits = function (subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - enumerable: false, - writable: true, - configurable: true - } - }); - if (superClass) subClass.__proto__ = superClass; -}; +var _inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }; var BaseController = (function (_Chaplin$Controller) { function BaseController() { @@ -37,4 +24,4 @@ var BaseController2 = (function (_Chaplin$Controller$Another) { _inherits(BaseController2, _Chaplin$Controller$Another); return BaseController2; -})(Chaplin.Controller.Another); +})(Chaplin.Controller.Another); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-classes-loose/super-class/expected.js b/test/fixtures/transformation/es6-classes-loose/super-class/expected.js index 00138df66c..b57997b371 100644 --- a/test/fixtures/transformation/es6-classes-loose/super-class/expected.js +++ b/test/fixtures/transformation/es6-classes-loose/super-class/expected.js @@ -1,19 +1,6 @@ "use strict"; -var _inherits = function (subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - enumerable: false, - writable: true, - configurable: true - } - }); - if (superClass) subClass.__proto__ = superClass; -}; +var _inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }; var Test = (function (Foo) { function Test() { @@ -25,4 +12,4 @@ var Test = (function (Foo) { _inherits(Test, Foo); return Test; -})(Foo); +})(Foo); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-classes/accessing-super-class/expected.js b/test/fixtures/transformation/es6-classes/accessing-super-class/expected.js index 11f7d6f5c4..33f4062609 100644 --- a/test/fixtures/transformation/es6-classes/accessing-super-class/expected.js +++ b/test/fixtures/transformation/es6-classes/accessing-super-class/expected.js @@ -1,47 +1,11 @@ "use strict"; var _slice = Array.prototype.slice; -var _prototypeProperties = function (child, staticProps, instanceProps) { - if (staticProps) Object.defineProperties(child, staticProps); - if (instanceProps) Object.defineProperties(child.prototype, instanceProps); -}; +var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; -var _get = function get(object, property, receiver) { - var desc = Object.getOwnPropertyDescriptor(object, property); +var _get = function get(object, property, receiver) { var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc && desc.writable) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - if (desc === undefined) { - var parent = Object.getPrototypeOf(object); - - if (parent === null) { - return undefined; - } else { - return get(parent, property, receiver); - } - } else if ("value" in desc && desc.writable) { - return desc.value; - } else { - var getter = desc.get; - if (getter === undefined) { - return undefined; - } - return getter.call(receiver); - } -}; - -var _inherits = function (subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - enumerable: false, - writable: true, - configurable: true - } - }); - if (superClass) subClass.__proto__ = superClass; -}; +var _inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }; var Test = (function (Foo) { function Test() { @@ -86,4 +50,4 @@ var Test = (function (Foo) { }); return Test; -})(Foo); +})(Foo); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-classes/accessing-super-properties/expected.js b/test/fixtures/transformation/es6-classes/accessing-super-properties/expected.js index f5a5d987a0..037d172454 100644 --- a/test/fixtures/transformation/es6-classes/accessing-super-properties/expected.js +++ b/test/fixtures/transformation/es6-classes/accessing-super-properties/expected.js @@ -1,41 +1,8 @@ "use strict"; -var _get = function get(object, property, receiver) { - var desc = Object.getOwnPropertyDescriptor(object, property); +var _get = function get(object, property, receiver) { var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc && desc.writable) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - if (desc === undefined) { - var parent = Object.getPrototypeOf(object); - - if (parent === null) { - return undefined; - } else { - return get(parent, property, receiver); - } - } else if ("value" in desc && desc.writable) { - return desc.value; - } else { - var getter = desc.get; - if (getter === undefined) { - return undefined; - } - return getter.call(receiver); - } -}; - -var _inherits = function (subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - enumerable: false, - writable: true, - configurable: true - } - }); - if (superClass) subClass.__proto__ = superClass; -}; +var _inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }; var Test = (function (Foo) { function Test() { @@ -46,4 +13,4 @@ var Test = (function (Foo) { _inherits(Test, Foo); return Test; -})(Foo); +})(Foo); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-classes/calling-super-properties/expected.js b/test/fixtures/transformation/es6-classes/calling-super-properties/expected.js index b82d42c705..9c6eced4d0 100644 --- a/test/fixtures/transformation/es6-classes/calling-super-properties/expected.js +++ b/test/fixtures/transformation/es6-classes/calling-super-properties/expected.js @@ -1,46 +1,10 @@ "use strict"; -var _prototypeProperties = function (child, staticProps, instanceProps) { - if (staticProps) Object.defineProperties(child, staticProps); - if (instanceProps) Object.defineProperties(child.prototype, instanceProps); -}; +var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; -var _get = function get(object, property, receiver) { - var desc = Object.getOwnPropertyDescriptor(object, property); +var _get = function get(object, property, receiver) { var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc && desc.writable) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - if (desc === undefined) { - var parent = Object.getPrototypeOf(object); - - if (parent === null) { - return undefined; - } else { - return get(parent, property, receiver); - } - } else if ("value" in desc && desc.writable) { - return desc.value; - } else { - var getter = desc.get; - if (getter === undefined) { - return undefined; - } - return getter.call(receiver); - } -}; - -var _inherits = function (subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - enumerable: false, - writable: true, - configurable: true - } - }); - if (superClass) subClass.__proto__ = superClass; -}; +var _inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }; var Test = (function (Foo) { function Test() { @@ -62,4 +26,4 @@ var Test = (function (Foo) { }); return Test; -})(Foo); +})(Foo); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-classes/constructor/expected.js b/test/fixtures/transformation/es6-classes/constructor/expected.js index 65ac6341b9..6750599c80 100644 --- a/test/fixtures/transformation/es6-classes/constructor/expected.js +++ b/test/fixtures/transformation/es6-classes/constructor/expected.js @@ -1,19 +1,6 @@ "use strict"; -var _inherits = function (subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - enumerable: false, - writable: true, - configurable: true - } - }); - if (superClass) subClass.__proto__ = superClass; -}; +var _inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }; var Test = function Test() { this.state = "test"; @@ -27,4 +14,4 @@ var Foo = (function (Bar) { _inherits(Foo, Bar); return Foo; -})(Bar); +})(Bar); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-classes/instance-getter-and-setter/expected.js b/test/fixtures/transformation/es6-classes/instance-getter-and-setter/expected.js index 84aa671d05..52dcc06d91 100644 --- a/test/fixtures/transformation/es6-classes/instance-getter-and-setter/expected.js +++ b/test/fixtures/transformation/es6-classes/instance-getter-and-setter/expected.js @@ -1,9 +1,6 @@ "use strict"; -var _prototypeProperties = function (child, staticProps, instanceProps) { - if (staticProps) Object.defineProperties(child, staticProps); - if (instanceProps) Object.defineProperties(child.prototype, instanceProps); -}; +var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; var Test = (function () { function Test() {} @@ -22,4 +19,4 @@ var Test = (function () { }); return Test; -})(); +})(); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-classes/instance-getter/expected.js b/test/fixtures/transformation/es6-classes/instance-getter/expected.js index bc21a9f701..a699f0bdeb 100644 --- a/test/fixtures/transformation/es6-classes/instance-getter/expected.js +++ b/test/fixtures/transformation/es6-classes/instance-getter/expected.js @@ -1,9 +1,6 @@ "use strict"; -var _prototypeProperties = function (child, staticProps, instanceProps) { - if (staticProps) Object.defineProperties(child, staticProps); - if (instanceProps) Object.defineProperties(child.prototype, instanceProps); -}; +var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; var Test = (function () { function Test() {} @@ -19,4 +16,4 @@ var Test = (function () { }); return Test; -})(); +})(); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-classes/instance-method/expected.js b/test/fixtures/transformation/es6-classes/instance-method/expected.js index f632a93cba..ff9659463c 100644 --- a/test/fixtures/transformation/es6-classes/instance-method/expected.js +++ b/test/fixtures/transformation/es6-classes/instance-method/expected.js @@ -1,9 +1,6 @@ "use strict"; -var _prototypeProperties = function (child, staticProps, instanceProps) { - if (staticProps) Object.defineProperties(child, staticProps); - if (instanceProps) Object.defineProperties(child.prototype, instanceProps); -}; +var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; var Test = (function () { function Test() {} @@ -20,4 +17,4 @@ var Test = (function () { }); return Test; -})(); +})(); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-classes/instance-setter/expected.js b/test/fixtures/transformation/es6-classes/instance-setter/expected.js index 0e550d2be2..f91083502f 100644 --- a/test/fixtures/transformation/es6-classes/instance-setter/expected.js +++ b/test/fixtures/transformation/es6-classes/instance-setter/expected.js @@ -1,9 +1,6 @@ "use strict"; -var _prototypeProperties = function (child, staticProps, instanceProps) { - if (staticProps) Object.defineProperties(child, staticProps); - if (instanceProps) Object.defineProperties(child.prototype, instanceProps); -}; +var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; var Test = (function () { function Test() {} @@ -19,4 +16,4 @@ var Test = (function () { }); return Test; -})(); +})(); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-classes/statement/expected.js b/test/fixtures/transformation/es6-classes/statement/expected.js index ac555c8256..1df4e3e60d 100644 --- a/test/fixtures/transformation/es6-classes/statement/expected.js +++ b/test/fixtures/transformation/es6-classes/statement/expected.js @@ -1,9 +1,6 @@ "use strict"; -var _prototypeProperties = function (child, staticProps, instanceProps) { - if (staticProps) Object.defineProperties(child, staticProps); - if (instanceProps) Object.defineProperties(child.prototype, instanceProps); -}; +var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; var BaseView = function BaseView() { this.autoRender = true; @@ -28,4 +25,4 @@ var BaseView = (function () { }); return BaseView; -})(); +})(); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-classes/static/expected.js b/test/fixtures/transformation/es6-classes/static/expected.js index b219f347c7..40c9dc6d51 100644 --- a/test/fixtures/transformation/es6-classes/static/expected.js +++ b/test/fixtures/transformation/es6-classes/static/expected.js @@ -1,9 +1,6 @@ "use strict"; -var _prototypeProperties = function (child, staticProps, instanceProps) { - if (staticProps) Object.defineProperties(child, staticProps); - if (instanceProps) Object.defineProperties(child.prototype, instanceProps); -}; +var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; var A = (function () { function A() {} @@ -24,4 +21,4 @@ var A = (function () { }); return A; -})(); +})(); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-classes/super-class-id-member-expression/expected.js b/test/fixtures/transformation/es6-classes/super-class-id-member-expression/expected.js index a85683bfb4..9ec5c36b3c 100644 --- a/test/fixtures/transformation/es6-classes/super-class-id-member-expression/expected.js +++ b/test/fixtures/transformation/es6-classes/super-class-id-member-expression/expected.js @@ -1,19 +1,6 @@ "use strict"; -var _inherits = function (subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - enumerable: false, - writable: true, - configurable: true - } - }); - if (superClass) subClass.__proto__ = superClass; -}; +var _inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }; var BaseController = (function (_Chaplin$Controller) { function BaseController() { @@ -37,4 +24,4 @@ var BaseController2 = (function (_Chaplin$Controller$Another) { _inherits(BaseController2, _Chaplin$Controller$Another); return BaseController2; -})(Chaplin.Controller.Another); +})(Chaplin.Controller.Another); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-classes/super-class/expected.js b/test/fixtures/transformation/es6-classes/super-class/expected.js index 89dad302fb..845d1c9f91 100644 --- a/test/fixtures/transformation/es6-classes/super-class/expected.js +++ b/test/fixtures/transformation/es6-classes/super-class/expected.js @@ -1,19 +1,6 @@ "use strict"; -var _inherits = function (subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - enumerable: false, - writable: true, - configurable: true - } - }); - if (superClass) subClass.__proto__ = superClass; -}; +var _inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }; var Test = (function (Foo) { function Test() { @@ -25,4 +12,4 @@ var Test = (function (Foo) { _inherits(Test, Foo); return Test; -})(Foo); +})(Foo); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-classes/super-function-fallback/expected.js b/test/fixtures/transformation/es6-classes/super-function-fallback/expected.js index 04edcd5902..09fb4b2cea 100644 --- a/test/fixtures/transformation/es6-classes/super-function-fallback/expected.js +++ b/test/fixtures/transformation/es6-classes/super-function-fallback/expected.js @@ -1,28 +1,7 @@ "use strict"; -var _get = function get(object, property, receiver) { - var desc = Object.getOwnPropertyDescriptor(object, property); - - if (desc === undefined) { - var parent = Object.getPrototypeOf(object); - - if (parent === null) { - return undefined; - } else { - return get(parent, property, receiver); - } - } else if ("value" in desc && desc.writable) { - return desc.value; - } else { - var getter = desc.get; - if (getter === undefined) { - return undefined; - } - return getter.call(receiver); - } -}; +var _get = function get(object, property, receiver) { var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc && desc.writable) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; var Test = function Test() { _get(Object.getPrototypeOf(Test.prototype), "hasOwnProperty", this).call(this, "test"); -}; - +}; \ No newline at end of file diff --git a/test/fixtures/transformation/es6-destructuring/array/expected.js b/test/fixtures/transformation/es6-destructuring/array/expected.js index 2884d34cc7..bd98c5b8db 100644 --- a/test/fixtures/transformation/es6-destructuring/array/expected.js +++ b/test/fixtures/transformation/es6-destructuring/array/expected.js @@ -1,20 +1,6 @@ "use strict"; -var _slicedToArray = function (arr, i) { - if (Array.isArray(arr)) { - return arr; - } else { - var _arr = []; - - for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { - _arr.push(_step.value); - - if (i && _arr.length === i) break; - } - - return _arr; - } -}; +var _slicedToArray = function (arr, i) { if (Array.isArray(arr)) { return arr; } else { var _arr = []; for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { _arr.push(_step.value); if (i && _arr.length === i) break; } return _arr; } }; var _ref = ["hello", [", ", "junk"], ["world"]]; @@ -25,4 +11,4 @@ var b = _ref$1[0]; var _ref$2 = _slicedToArray(_ref[2], 1); var c = _ref$2[0]; -var d = _ref[3]; +var d = _ref[3]; \ No newline at end of file diff --git a/test/fixtures/transformation/es6-destructuring/assignment-expression/expected.js b/test/fixtures/transformation/es6-destructuring/assignment-expression/expected.js index d626efc045..79c3a0d98c 100644 --- a/test/fixtures/transformation/es6-destructuring/assignment-expression/expected.js +++ b/test/fixtures/transformation/es6-destructuring/assignment-expression/expected.js @@ -1,20 +1,6 @@ "use strict"; var _temp, _temp2; -var _slicedToArray = function (arr, i) { - if (Array.isArray(arr)) { - return arr; - } else { - var _arr = []; +var _slicedToArray = function (arr, i) { if (Array.isArray(arr)) { return arr; } else { var _arr = []; for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { _arr.push(_step.value); if (i && _arr.length === i) break; } return _arr; } }; - for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { - _arr.push(_step.value); - - if (i && _arr.length === i) break; - } - - return _arr; - } -}; - -console.log((_temp = [123], _temp2 = _slicedToArray(_temp, 1), x = _temp2[0], _temp)); +console.log((_temp = [123], _temp2 = _slicedToArray(_temp, 1), x = _temp2[0], _temp)); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-destructuring/assignment-statement/expected.js b/test/fixtures/transformation/es6-destructuring/assignment-statement/expected.js index f48bb1e729..c0f9d340ed 100644 --- a/test/fixtures/transformation/es6-destructuring/assignment-statement/expected.js +++ b/test/fixtures/transformation/es6-destructuring/assignment-statement/expected.js @@ -1,20 +1,6 @@ "use strict"; -var _slicedToArray = function (arr, i) { - if (Array.isArray(arr)) { - return arr; - } else { - var _arr = []; - - for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { - _arr.push(_step.value); - - if (i && _arr.length === i) break; - } - - return _arr; - } -}; +var _slicedToArray = function (arr, i) { if (Array.isArray(arr)) { return arr; } else { var _arr = []; for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { _arr.push(_step.value); if (i && _arr.length === i) break; } return _arr; } }; var _ref = f(); @@ -22,4 +8,4 @@ var _ref2 = _slicedToArray(_ref, 2); a = _ref2[0]; b = _ref2[1]; -; +; \ No newline at end of file diff --git a/test/fixtures/transformation/es6-destructuring/empty/expected.js b/test/fixtures/transformation/es6-destructuring/empty/expected.js index 64b5f22ae6..2d612a2e44 100644 --- a/test/fixtures/transformation/es6-destructuring/empty/expected.js +++ b/test/fixtures/transformation/es6-destructuring/empty/expected.js @@ -1,20 +1,6 @@ "use strict"; -var _slicedToArray = function (arr, i) { - if (Array.isArray(arr)) { - return arr; - } else { - var _arr = []; - - for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { - _arr.push(_step.value); - - if (i && _arr.length === i) break; - } - - return _arr; - } -}; +var _slicedToArray = function (arr, i) { if (Array.isArray(arr)) { return arr; } else { var _arr = []; for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { _arr.push(_step.value); if (i && _arr.length === i) break; } return _arr; } }; var _ref = ["foo", "hello", [", ", "junk"], ["world"]]; @@ -25,4 +11,4 @@ var b = _ref$2[0]; var _ref$3 = _slicedToArray(_ref[3], 1); var c = _ref$3[0]; -var d = _ref[4]; +var d = _ref[4]; \ No newline at end of file diff --git a/test/fixtures/transformation/es6-destructuring/es7-object-rest/expected.js b/test/fixtures/transformation/es6-destructuring/es7-object-rest/expected.js index dbb29cb23d..8f78f9f6f2 100644 --- a/test/fixtures/transformation/es6-destructuring/es7-object-rest/expected.js +++ b/test/fixtures/transformation/es6-destructuring/es7-object-rest/expected.js @@ -1,16 +1,6 @@ "use strict"; -var _objectWithoutProperties = function (obj, keys) { - var target = {}; - - for (var i in obj) { - if (keys.indexOf(i) >= 0) continue; - if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; - target[i] = obj[i]; - } - - return target; -}; +var _objectWithoutProperties = function (obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }; var x = _objectWithoutProperties(z, []); @@ -20,4 +10,4 @@ var y = _objectWithoutProperties(z, ["x"]); (function (_ref) { var x = _ref.x; var y = _objectWithoutProperties(_ref, ["x"]); -}); +}); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-destructuring/for-in/expected.js b/test/fixtures/transformation/es6-destructuring/for-in/expected.js index dc5db21a02..0e8d711009 100644 --- a/test/fixtures/transformation/es6-destructuring/for-in/expected.js +++ b/test/fixtures/transformation/es6-destructuring/for-in/expected.js @@ -1,20 +1,6 @@ "use strict"; -var _slicedToArray = function (arr, i) { - if (Array.isArray(arr)) { - return arr; - } else { - var _arr = []; - - for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { - _arr.push(_step.value); - - if (i && _arr.length === i) break; - } - - return _arr; - } -}; +var _slicedToArray = function (arr, i) { if (Array.isArray(arr)) { return arr; } else { var _arr = []; for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { _arr.push(_step.value); if (i && _arr.length === i) break; } return _arr; } }; for (var _ref in obj) { var _ref2 = _slicedToArray(_ref, 2); @@ -22,4 +8,4 @@ for (var _ref in obj) { var name = _ref2[0]; var value = _ref2[1]; print("Name: " + name + ", Value: " + value); -} +} \ No newline at end of file diff --git a/test/fixtures/transformation/es6-destructuring/for-of/expected.js b/test/fixtures/transformation/es6-destructuring/for-of/expected.js index d564f1bf2b..665973916b 100644 --- a/test/fixtures/transformation/es6-destructuring/for-of/expected.js +++ b/test/fixtures/transformation/es6-destructuring/for-of/expected.js @@ -1,20 +1,6 @@ "use strict"; -var _slicedToArray = function (arr, i) { - if (Array.isArray(arr)) { - return arr; - } else { - var _arr = []; - - for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { - _arr.push(_step.value); - - if (i && _arr.length === i) break; - } - - return _arr; - } -}; +var _slicedToArray = function (arr, i) { if (Array.isArray(arr)) { return arr; } else { var _arr = []; for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { _arr.push(_step.value); if (i && _arr.length === i) break; } return _arr; } }; for (var _iterator = test.expectation.registers[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { var _step$value = _slicedToArray(_step.value, 3); @@ -22,4 +8,4 @@ for (var _iterator = test.expectation.registers[Symbol.iterator](), _step; !(_st var name = _step$value[0]; var before = _step$value[1]; var after = _step$value[2]; -} +} \ No newline at end of file diff --git a/test/fixtures/transformation/es6-destructuring/member-expression/expected.js b/test/fixtures/transformation/es6-destructuring/member-expression/expected.js index 5cfaa9660c..d5a1037299 100644 --- a/test/fixtures/transformation/es6-destructuring/member-expression/expected.js +++ b/test/fixtures/transformation/es6-destructuring/member-expression/expected.js @@ -1,20 +1,6 @@ "use strict"; -var _slicedToArray = function (arr, i) { - if (Array.isArray(arr)) { - return arr; - } else { - var _arr = []; - - for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { - _arr.push(_step.value); - - if (i && _arr.length === i) break; - } - - return _arr; - } -}; +var _slicedToArray = function (arr, i) { if (Array.isArray(arr)) { return arr; } else { var _arr = []; for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { _arr.push(_step.value); if (i && _arr.length === i) break; } return _arr; } }; var _ref = [1, 2]; @@ -22,4 +8,4 @@ var _ref2 = _slicedToArray(_ref, 2); foo.foo = _ref2[0]; foo.bar = _ref2[1]; -; +; \ No newline at end of file diff --git a/test/fixtures/transformation/es6-destructuring/mixed/expected.js b/test/fixtures/transformation/es6-destructuring/mixed/expected.js index 9464df1648..cd4e7a9e82 100644 --- a/test/fixtures/transformation/es6-destructuring/mixed/expected.js +++ b/test/fixtures/transformation/es6-destructuring/mixed/expected.js @@ -1,20 +1,6 @@ "use strict"; -var _slicedToArray = function (arr, i) { - if (Array.isArray(arr)) { - return arr; - } else { - var _arr = []; - - for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { - _arr.push(_step.value); - - if (i && _arr.length === i) break; - } - - return _arr; - } -}; +var _slicedToArray = function (arr, i) { if (Array.isArray(arr)) { return arr; } else { var _arr = []; for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { _arr.push(_step.value); if (i && _arr.length === i) break; } return _arr; } }; var _rect$topLeft = _slicedToArray(rect.topLeft, 2); @@ -23,4 +9,4 @@ var y1 = _rect$topLeft[1]; var _rect$bottomRight = _slicedToArray(rect.bottomRight, 2); var x2 = _rect$bottomRight[0]; -var y2 = _rect$bottomRight[1]; +var y2 = _rect$bottomRight[1]; \ No newline at end of file diff --git a/test/fixtures/transformation/es6-destructuring/parameters/expected.js b/test/fixtures/transformation/es6-destructuring/parameters/expected.js index 1c847ab56d..2b21e4bedf 100644 --- a/test/fixtures/transformation/es6-destructuring/parameters/expected.js +++ b/test/fixtures/transformation/es6-destructuring/parameters/expected.js @@ -1,20 +1,6 @@ "use strict"; -var _slicedToArray = function (arr, i) { - if (Array.isArray(arr)) { - return arr; - } else { - var _arr = []; - - for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { - _arr.push(_step.value); - - if (i && _arr.length === i) break; - } - - return _arr; - } -}; +var _slicedToArray = function (arr, i) { if (Array.isArray(arr)) { return arr; } else { var _arr = []; for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { _arr.push(_step.value); if (i && _arr.length === i) break; } return _arr; } }; function somethingAdvanced(_ref) { var x1 = _ref.topLeft.x; @@ -45,4 +31,4 @@ var unpackArray = function (_ref, _ref3) { return a + b + c; }; -console.log(unpackArray(["hello", ", ", "world"], [1, 2, 3])); +console.log(unpackArray(["hello", ", ", "world"], [1, 2, 3])); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-destructuring/spread/expected.js b/test/fixtures/transformation/es6-destructuring/spread/expected.js index 93ed191346..d7543faac6 100644 --- a/test/fixtures/transformation/es6-destructuring/spread/expected.js +++ b/test/fixtures/transformation/es6-destructuring/spread/expected.js @@ -1,8 +1,6 @@ "use strict"; -var _toArray = function (arr) { - return Array.isArray(arr) ? arr : Array.from(arr); -}; +var _toArray = function (arr) { return Array.isArray(arr) ? arr : Array.from(arr); }; var isSorted = function (_ref) { var _ref2 = _toArray(_ref); @@ -14,4 +12,4 @@ var isSorted = function (_ref) { if (!zs.length) return true; if (y > x) return isSorted(zs); return false; -}; +}; \ No newline at end of file diff --git a/test/fixtures/transformation/es6-modules-amd/exports-from/expected.js b/test/fixtures/transformation/es6-modules-amd/exports-from/expected.js index cf42241636..e99414734f 100644 --- a/test/fixtures/transformation/es6-modules-amd/exports-from/expected.js +++ b/test/fixtures/transformation/es6-modules-amd/exports-from/expected.js @@ -1,21 +1,9 @@ define(["exports", "foo"], function (exports, _foo) { "use strict"; - var _interopRequireWildcard = function (obj) { - return obj && obj.__esModule ? obj : { - "default": obj - }; - }; + var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { "default": obj }; }; - var _defaults = function (obj, defaults) { - for (var key in defaults) { - if (obj[key] === undefined) { - obj[key] = defaults[key]; - } - } - - return obj; - }; + var _defaults = function (obj, defaults) { for (var key in defaults) { if (obj[key] === undefined) { obj[key] = defaults[key]; } } return obj; }; _defaults(exports, _interopRequireWildcard(_foo)); @@ -27,4 +15,4 @@ define(["exports", "foo"], function (exports, _foo) { exports["default"] = _foo.foo; exports.bar = _foo.bar; exports.__esModule = true; -}); +}); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-modules-amd/imports-default/expected.js b/test/fixtures/transformation/es6-modules-amd/imports-default/expected.js index b983b462ed..4575943441 100644 --- a/test/fixtures/transformation/es6-modules-amd/imports-default/expected.js +++ b/test/fixtures/transformation/es6-modules-amd/imports-default/expected.js @@ -1,11 +1,9 @@ define(["exports", "foo"], function (exports, _foo) { "use strict"; - var _interopRequire = function (obj) { - return obj && obj.__esModule ? obj["default"] : obj; - }; + var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; var foo = _interopRequire(_foo); var foo2 = _interopRequire(_foo); -}); +}); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-modules-amd/imports-mixing/expected.js b/test/fixtures/transformation/es6-modules-amd/imports-mixing/expected.js index 8d9fb05272..b147224a07 100644 --- a/test/fixtures/transformation/es6-modules-amd/imports-mixing/expected.js +++ b/test/fixtures/transformation/es6-modules-amd/imports-mixing/expected.js @@ -1,11 +1,9 @@ define(["exports", "foo"], function (exports, _foo) { "use strict"; - var _interopRequire = function (obj) { - return obj && obj.__esModule ? obj["default"] : obj; - }; + var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; var foo = _interopRequire(_foo); var xyz = _foo.baz; -}); +}); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-modules-amd/overview/expected.js b/test/fixtures/transformation/es6-modules-amd/overview/expected.js index af24247f5d..6970be8134 100644 --- a/test/fixtures/transformation/es6-modules-amd/overview/expected.js +++ b/test/fixtures/transformation/es6-modules-amd/overview/expected.js @@ -1,9 +1,7 @@ define(["exports", "foo", "foo-bar", "./directory/foo-bar"], function (exports, _foo, _fooBar, _directoryFooBar) { "use strict"; - var _interopRequire = function (obj) { - return obj && obj.__esModule ? obj["default"] : obj; - }; + var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; var foo = _interopRequire(_foo); diff --git a/test/fixtures/transformation/es6-modules-common/exports-from/expected.js b/test/fixtures/transformation/es6-modules-common/exports-from/expected.js index 2fe19bbcb7..3f8dc1d7a3 100644 --- a/test/fixtures/transformation/es6-modules-common/exports-from/expected.js +++ b/test/fixtures/transformation/es6-modules-common/exports-from/expected.js @@ -1,20 +1,8 @@ "use strict"; -var _interopRequireWildcard = function (obj) { - return obj && obj.__esModule ? obj : { - "default": obj - }; -}; +var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { "default": obj }; }; -var _defaults = function (obj, defaults) { - for (var key in defaults) { - if (obj[key] === undefined) { - obj[key] = defaults[key]; - } - } - - return obj; -}; +var _defaults = function (obj, defaults) { for (var key in defaults) { if (obj[key] === undefined) { obj[key] = defaults[key]; } } return obj; }; var _foo = require("foo"); @@ -27,4 +15,4 @@ exports.bar = _foo.foo; exports["default"] = _foo.foo; exports["default"] = _foo.foo; exports.bar = _foo.bar; -exports.__esModule = true; +exports.__esModule = true; \ No newline at end of file diff --git a/test/fixtures/transformation/es6-modules-common/imports-default/expected.js b/test/fixtures/transformation/es6-modules-common/imports-default/expected.js index 8ab754a5fd..5555557129 100644 --- a/test/fixtures/transformation/es6-modules-common/imports-default/expected.js +++ b/test/fixtures/transformation/es6-modules-common/imports-default/expected.js @@ -1,8 +1,6 @@ "use strict"; -var _interopRequire = function (obj) { - return obj && obj.__esModule ? obj["default"] : obj; -}; +var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; var _foo = require("foo"); diff --git a/test/fixtures/transformation/es6-modules-common/imports-glob/expected.js b/test/fixtures/transformation/es6-modules-common/imports-glob/expected.js index fe1f3744eb..262b38819c 100644 --- a/test/fixtures/transformation/es6-modules-common/imports-glob/expected.js +++ b/test/fixtures/transformation/es6-modules-common/imports-glob/expected.js @@ -1,9 +1,5 @@ "use strict"; -var _interopRequireWildcard = function (obj) { - return obj && obj.__esModule ? obj : { - "default": obj - }; -}; +var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { "default": obj }; }; -var foo = _interopRequireWildcard(require("foo")); +var foo = _interopRequireWildcard(require("foo")); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-modules-common/imports-mixing/expected.js b/test/fixtures/transformation/es6-modules-common/imports-mixing/expected.js index 5aba49cf35..0cbe0c73f3 100644 --- a/test/fixtures/transformation/es6-modules-common/imports-mixing/expected.js +++ b/test/fixtures/transformation/es6-modules-common/imports-mixing/expected.js @@ -1,8 +1,6 @@ "use strict"; -var _interopRequire = function (obj) { - return obj && obj.__esModule ? obj["default"] : obj; -}; +var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; var _foo = require("foo"); diff --git a/test/fixtures/transformation/es6-modules-common/overview/expected.js b/test/fixtures/transformation/es6-modules-common/overview/expected.js index ced6426b15..038e74c451 100644 --- a/test/fixtures/transformation/es6-modules-common/overview/expected.js +++ b/test/fixtures/transformation/es6-modules-common/overview/expected.js @@ -1,14 +1,8 @@ "use strict"; -var _interopRequireWildcard = function (obj) { - return obj && obj.__esModule ? obj : { - "default": obj - }; -}; +var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { "default": obj }; }; -var _interopRequire = function (obj) { - return obj && obj.__esModule ? obj["default"] : obj; -}; +var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; require("foo"); @@ -24,4 +18,4 @@ var bar = require("foo4").bar; var bar2 = require("foo5").foo; exports.test = test; var test = exports.test = 5; -exports.__esModule = true; +exports.__esModule = true; \ No newline at end of file diff --git a/test/fixtures/transformation/es6-modules-umd/exports-from/expected.js b/test/fixtures/transformation/es6-modules-umd/exports-from/expected.js index 06519eeab6..9b4c8ed6b1 100644 --- a/test/fixtures/transformation/es6-modules-umd/exports-from/expected.js +++ b/test/fixtures/transformation/es6-modules-umd/exports-from/expected.js @@ -7,21 +7,9 @@ })(function (exports, _foo) { "use strict"; - var _interopRequireWildcard = function (obj) { - return obj && obj.__esModule ? obj : { - "default": obj - }; - }; + var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { "default": obj }; }; - var _defaults = function (obj, defaults) { - for (var key in defaults) { - if (obj[key] === undefined) { - obj[key] = defaults[key]; - } - } - - return obj; - }; + var _defaults = function (obj, defaults) { for (var key in defaults) { if (obj[key] === undefined) { obj[key] = defaults[key]; } } return obj; }; _defaults(exports, _interopRequireWildcard(_foo)); @@ -33,4 +21,4 @@ exports["default"] = _foo.foo; exports.bar = _foo.bar; exports.__esModule = true; -}); +}); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-modules-umd/imports-default/expected.js b/test/fixtures/transformation/es6-modules-umd/imports-default/expected.js index 9dffd5ee3e..46111b877c 100644 --- a/test/fixtures/transformation/es6-modules-umd/imports-default/expected.js +++ b/test/fixtures/transformation/es6-modules-umd/imports-default/expected.js @@ -7,11 +7,9 @@ })(function (exports, _foo) { "use strict"; - var _interopRequire = function (obj) { - return obj && obj.__esModule ? obj["default"] : obj; - }; + var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; var foo = _interopRequire(_foo); var foo2 = _interopRequire(_foo); -}); +}); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-modules-umd/imports-mixing/expected.js b/test/fixtures/transformation/es6-modules-umd/imports-mixing/expected.js index 85c3161db2..6b684e31de 100644 --- a/test/fixtures/transformation/es6-modules-umd/imports-mixing/expected.js +++ b/test/fixtures/transformation/es6-modules-umd/imports-mixing/expected.js @@ -7,11 +7,9 @@ })(function (exports, _foo) { "use strict"; - var _interopRequire = function (obj) { - return obj && obj.__esModule ? obj["default"] : obj; - }; + var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; var foo = _interopRequire(_foo); var xyz = _foo.baz; -}); +}); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-modules-umd/overview/expected.js b/test/fixtures/transformation/es6-modules-umd/overview/expected.js index a6c68320be..ab37f4c843 100644 --- a/test/fixtures/transformation/es6-modules-umd/overview/expected.js +++ b/test/fixtures/transformation/es6-modules-umd/overview/expected.js @@ -7,9 +7,7 @@ })(function (exports, _foo, _fooBar, _directoryFooBar) { "use strict"; - var _interopRequire = function (obj) { - return obj && obj.__esModule ? obj["default"] : obj; - }; + var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; var foo = _interopRequire(_foo); diff --git a/test/fixtures/transformation/es6-properties.computed/argument/expected.js b/test/fixtures/transformation/es6-properties.computed/argument/expected.js index 543b8d3166..0846d43ac3 100644 --- a/test/fixtures/transformation/es6-properties.computed/argument/expected.js +++ b/test/fixtures/transformation/es6-properties.computed/argument/expected.js @@ -1,12 +1,5 @@ "use strict"; -var _defineProperty = function (obj, key, value) { - return Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); -}; +var _defineProperty = function (obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); }; -foo(_defineProperty({}, bar, "foobar")); +foo(_defineProperty({}, bar, "foobar")); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-properties.computed/assignment/expected.js b/test/fixtures/transformation/es6-properties.computed/assignment/expected.js index 1ba34e86f5..0519057c40 100644 --- a/test/fixtures/transformation/es6-properties.computed/assignment/expected.js +++ b/test/fixtures/transformation/es6-properties.computed/assignment/expected.js @@ -1,12 +1,5 @@ "use strict"; -var _defineProperty = function (obj, key, value) { - return Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); -}; +var _defineProperty = function (obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); }; -foo = _defineProperty({}, bar, "foobar"); +foo = _defineProperty({}, bar, "foobar"); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-properties.computed/method/expected.js b/test/fixtures/transformation/es6-properties.computed/method/expected.js index a4c9782668..79dca450d3 100644 --- a/test/fixtures/transformation/es6-properties.computed/method/expected.js +++ b/test/fixtures/transformation/es6-properties.computed/method/expected.js @@ -1,14 +1,7 @@ "use strict"; -var _defineProperty = function (obj, key, value) { - return Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); -}; +var _defineProperty = function (obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); }; var obj = _defineProperty({}, foobar, function () { return "foobar"; -}); +}); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-properties.computed/mixed/expected.js b/test/fixtures/transformation/es6-properties.computed/mixed/expected.js index afab9e7b3f..35cd829c19 100644 --- a/test/fixtures/transformation/es6-properties.computed/mixed/expected.js +++ b/test/fixtures/transformation/es6-properties.computed/mixed/expected.js @@ -1,13 +1,6 @@ "use strict"; -var _defineProperty = function (obj, key, value) { - return Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); -}; +var _defineProperty = function (obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); }; var obj = (function () { var _obj = {}; @@ -21,4 +14,4 @@ var obj = (function () { _defineProperty(_obj, "bar", "bar"); return _obj; -})(); +})(); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-properties.computed/multiple/expected.js b/test/fixtures/transformation/es6-properties.computed/multiple/expected.js index df5da87983..04c9c32c5d 100644 --- a/test/fixtures/transformation/es6-properties.computed/multiple/expected.js +++ b/test/fixtures/transformation/es6-properties.computed/multiple/expected.js @@ -1,13 +1,6 @@ "use strict"; -var _defineProperty = function (obj, key, value) { - return Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); -}; +var _defineProperty = function (obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); }; var obj = (function () { var _obj = {}; @@ -17,4 +10,4 @@ var obj = (function () { _defineProperty(_obj, "y" + bar, "noo"); return _obj; -})(); +})(); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-properties.computed/single/expected.js b/test/fixtures/transformation/es6-properties.computed/single/expected.js index 8b9c799cb7..937caa1d20 100644 --- a/test/fixtures/transformation/es6-properties.computed/single/expected.js +++ b/test/fixtures/transformation/es6-properties.computed/single/expected.js @@ -1,12 +1,5 @@ "use strict"; -var _defineProperty = function (obj, key, value) { - return Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); -}; +var _defineProperty = function (obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); }; -var obj = _defineProperty({}, "x" + foo, "heh"); +var obj = _defineProperty({}, "x" + foo, "heh"); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-properties.computed/this/expected.js b/test/fixtures/transformation/es6-properties.computed/this/expected.js index 7f573491fd..c8aa05c062 100644 --- a/test/fixtures/transformation/es6-properties.computed/this/expected.js +++ b/test/fixtures/transformation/es6-properties.computed/this/expected.js @@ -1,12 +1,5 @@ "use strict"; -var _defineProperty = function (obj, key, value) { - return Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); -}; +var _defineProperty = function (obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); }; -var obj = _defineProperty({}, "x" + foo.bar, "heh"); +var obj = _defineProperty({}, "x" + foo.bar, "heh"); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-properties.computed/two/expected.js b/test/fixtures/transformation/es6-properties.computed/two/expected.js index 933bca223b..567304d624 100644 --- a/test/fixtures/transformation/es6-properties.computed/two/expected.js +++ b/test/fixtures/transformation/es6-properties.computed/two/expected.js @@ -1,13 +1,6 @@ "use strict"; -var _defineProperty = function (obj, key, value) { - return Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); -}; +var _defineProperty = function (obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); }; var obj = _defineProperty({ - first: "first" }, "second", "second"); + first: "first" }, "second", "second"); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-properties.computed/variable/expected.js b/test/fixtures/transformation/es6-properties.computed/variable/expected.js index 18819eecab..c59c5d07b9 100644 --- a/test/fixtures/transformation/es6-properties.computed/variable/expected.js +++ b/test/fixtures/transformation/es6-properties.computed/variable/expected.js @@ -1,12 +1,5 @@ "use strict"; -var _defineProperty = function (obj, key, value) { - return Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); -}; +var _defineProperty = function (obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); }; -var foo = _defineProperty({}, bar, "foobar"); +var foo = _defineProperty({}, bar, "foobar"); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-properties.shorthand/method-computed/expected.js b/test/fixtures/transformation/es6-properties.shorthand/method-computed/expected.js index aa6f306654..240e3e05a1 100644 --- a/test/fixtures/transformation/es6-properties.shorthand/method-computed/expected.js +++ b/test/fixtures/transformation/es6-properties.shorthand/method-computed/expected.js @@ -1,13 +1,6 @@ "use strict"; -var _defineProperty = function (obj, key, value) { - return Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); -}; +var _defineProperty = function (obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); }; var x = "y"; var valueSet; @@ -22,4 +15,4 @@ var obj = Object.defineProperties({}, _defineProperty({}, x, { configurable: true })); obj.y = "foo"; -obj.y === 1 && valueSet === "foo"; +obj.y === 1 && valueSet === "foo"; \ No newline at end of file diff --git a/test/fixtures/transformation/es6-spread/array-literal-first/expected.js b/test/fixtures/transformation/es6-spread/array-literal-first/expected.js index 05d2c2e6f8..4f599ff941 100644 --- a/test/fixtures/transformation/es6-spread/array-literal-first/expected.js +++ b/test/fixtures/transformation/es6-spread/array-literal-first/expected.js @@ -1,7 +1,5 @@ "use strict"; -var _toArray = function (arr) { - return Array.isArray(arr) ? arr : Array.from(arr); -}; +var _toArray = function (arr) { return Array.isArray(arr) ? arr : Array.from(arr); }; -var lyrics = [].concat(_toArray(parts), ["head", "and", "toes"]); +var lyrics = [].concat(_toArray(parts), ["head", "and", "toes"]); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-spread/array-literal-middle/expected.js b/test/fixtures/transformation/es6-spread/array-literal-middle/expected.js index 36bf1e3cf9..74fb15b350 100644 --- a/test/fixtures/transformation/es6-spread/array-literal-middle/expected.js +++ b/test/fixtures/transformation/es6-spread/array-literal-middle/expected.js @@ -1,7 +1,5 @@ "use strict"; -var _toArray = function (arr) { - return Array.isArray(arr) ? arr : Array.from(arr); -}; +var _toArray = function (arr) { return Array.isArray(arr) ? arr : Array.from(arr); }; -var a = [b].concat(_toArray(c), [d]); +var a = [b].concat(_toArray(c), [d]); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-spread/array-literal-multiple/expected.js b/test/fixtures/transformation/es6-spread/array-literal-multiple/expected.js index ae2a249cb1..5ddf59335e 100644 --- a/test/fixtures/transformation/es6-spread/array-literal-multiple/expected.js +++ b/test/fixtures/transformation/es6-spread/array-literal-multiple/expected.js @@ -1,7 +1,5 @@ "use strict"; -var _toArray = function (arr) { - return Array.isArray(arr) ? arr : Array.from(arr); -}; +var _toArray = function (arr) { return Array.isArray(arr) ? arr : Array.from(arr); }; -var a = [b].concat(_toArray(c), [d, e], _toArray(f)); +var a = [b].concat(_toArray(c), [d, e], _toArray(f)); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-spread/array-literals/expected.js b/test/fixtures/transformation/es6-spread/array-literals/expected.js index fa0b3c64d2..754ab5115c 100644 --- a/test/fixtures/transformation/es6-spread/array-literals/expected.js +++ b/test/fixtures/transformation/es6-spread/array-literals/expected.js @@ -1,7 +1,5 @@ "use strict"; -var _toArray = function (arr) { - return Array.isArray(arr) ? arr : Array.from(arr); -}; +var _toArray = function (arr) { return Array.isArray(arr) ? arr : Array.from(arr); }; -var lyrics = ["head", "and", "toes"].concat(_toArray(parts)); +var lyrics = ["head", "and", "toes"].concat(_toArray(parts)); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-spread/contexted-computed-method-call-multiple-args/expected.js b/test/fixtures/transformation/es6-spread/contexted-computed-method-call-multiple-args/expected.js index 2df1266ea6..fe2844f752 100644 --- a/test/fixtures/transformation/es6-spread/contexted-computed-method-call-multiple-args/expected.js +++ b/test/fixtures/transformation/es6-spread/contexted-computed-method-call-multiple-args/expected.js @@ -1,8 +1,6 @@ "use strict"; var _obj; -var _toArray = function (arr) { - return Array.isArray(arr) ? arr : Array.from(arr); -}; +var _toArray = function (arr) { return Array.isArray(arr) ? arr : Array.from(arr); }; -(_obj = obj)[method].apply(_obj, [foo, bar].concat(_toArray(args))); +(_obj = obj)[method].apply(_obj, [foo, bar].concat(_toArray(args))); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-spread/contexted-computed-method-call-single-arg/expected.js b/test/fixtures/transformation/es6-spread/contexted-computed-method-call-single-arg/expected.js index 787118ee8d..f87fa8da5c 100644 --- a/test/fixtures/transformation/es6-spread/contexted-computed-method-call-single-arg/expected.js +++ b/test/fixtures/transformation/es6-spread/contexted-computed-method-call-single-arg/expected.js @@ -1,8 +1,6 @@ "use strict"; var _obj; -var _toArray = function (arr) { - return Array.isArray(arr) ? arr : Array.from(arr); -}; +var _toArray = function (arr) { return Array.isArray(arr) ? arr : Array.from(arr); }; -(_obj = obj)[method].apply(_obj, _toArray(args)); +(_obj = obj)[method].apply(_obj, _toArray(args)); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-spread/contexted-method-call-multiple-args/expected.js b/test/fixtures/transformation/es6-spread/contexted-method-call-multiple-args/expected.js index 4286bae62f..5fc609a79c 100644 --- a/test/fixtures/transformation/es6-spread/contexted-method-call-multiple-args/expected.js +++ b/test/fixtures/transformation/es6-spread/contexted-method-call-multiple-args/expected.js @@ -1,9 +1,7 @@ "use strict"; var _foob, _foob$test; -var _toArray = function (arr) { - return Array.isArray(arr) ? arr : Array.from(arr); -}; +var _toArray = function (arr) { return Array.isArray(arr) ? arr : Array.from(arr); }; (_foob = foob).add.apply(_foob, [foo, bar].concat(_toArray(numbers))); -(_foob$test = foob.test).add.apply(_foob$test, [foo, bar].concat(_toArray(numbers))); +(_foob$test = foob.test).add.apply(_foob$test, [foo, bar].concat(_toArray(numbers))); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-spread/contexted-method-call-single-arg/expected.js b/test/fixtures/transformation/es6-spread/contexted-method-call-single-arg/expected.js index ea00630a64..fe958b7719 100644 --- a/test/fixtures/transformation/es6-spread/contexted-method-call-single-arg/expected.js +++ b/test/fixtures/transformation/es6-spread/contexted-method-call-single-arg/expected.js @@ -1,9 +1,7 @@ "use strict"; var _foob, _foob$test; -var _toArray = function (arr) { - return Array.isArray(arr) ? arr : Array.from(arr); -}; +var _toArray = function (arr) { return Array.isArray(arr) ? arr : Array.from(arr); }; (_foob = foob).add.apply(_foob, _toArray(numbers)); -(_foob$test = foob.test).add.apply(_foob$test, _toArray(numbers)); +(_foob$test = foob.test).add.apply(_foob$test, _toArray(numbers)); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-spread/method-call-first/expected.js b/test/fixtures/transformation/es6-spread/method-call-first/expected.js index 1e9fad9adc..ba8ad3b956 100644 --- a/test/fixtures/transformation/es6-spread/method-call-first/expected.js +++ b/test/fixtures/transformation/es6-spread/method-call-first/expected.js @@ -1,7 +1,5 @@ "use strict"; -var _toArray = function (arr) { - return Array.isArray(arr) ? arr : Array.from(arr); -}; +var _toArray = function (arr) { return Array.isArray(arr) ? arr : Array.from(arr); }; -add.apply(undefined, _toArray(numbers).concat([foo, bar])); +add.apply(undefined, _toArray(numbers).concat([foo, bar])); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-spread/method-call-middle/expected.js b/test/fixtures/transformation/es6-spread/method-call-middle/expected.js index aadd19e09e..d2a846d705 100644 --- a/test/fixtures/transformation/es6-spread/method-call-middle/expected.js +++ b/test/fixtures/transformation/es6-spread/method-call-middle/expected.js @@ -1,7 +1,5 @@ "use strict"; -var _toArray = function (arr) { - return Array.isArray(arr) ? arr : Array.from(arr); -}; +var _toArray = function (arr) { return Array.isArray(arr) ? arr : Array.from(arr); }; -add.apply(undefined, [foo].concat(_toArray(numbers), [bar])); +add.apply(undefined, [foo].concat(_toArray(numbers), [bar])); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-spread/method-call-multiple-args/expected.js b/test/fixtures/transformation/es6-spread/method-call-multiple-args/expected.js index 27fe7bf456..c256c920aa 100644 --- a/test/fixtures/transformation/es6-spread/method-call-multiple-args/expected.js +++ b/test/fixtures/transformation/es6-spread/method-call-multiple-args/expected.js @@ -1,7 +1,5 @@ "use strict"; -var _toArray = function (arr) { - return Array.isArray(arr) ? arr : Array.from(arr); -}; +var _toArray = function (arr) { return Array.isArray(arr) ? arr : Array.from(arr); }; -add.apply(undefined, [foo, bar].concat(_toArray(numbers))); +add.apply(undefined, [foo, bar].concat(_toArray(numbers))); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-spread/method-call-multiple/expected.js b/test/fixtures/transformation/es6-spread/method-call-multiple/expected.js index 334aa997d7..1ec67879ae 100644 --- a/test/fixtures/transformation/es6-spread/method-call-multiple/expected.js +++ b/test/fixtures/transformation/es6-spread/method-call-multiple/expected.js @@ -1,7 +1,5 @@ "use strict"; -var _toArray = function (arr) { - return Array.isArray(arr) ? arr : Array.from(arr); -}; +var _toArray = function (arr) { return Array.isArray(arr) ? arr : Array.from(arr); }; -add.apply(undefined, [foo].concat(_toArray(numbers), [bar, what], _toArray(test))); +add.apply(undefined, [foo].concat(_toArray(numbers), [bar, what], _toArray(test))); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-spread/method-call-single-arg/expected.js b/test/fixtures/transformation/es6-spread/method-call-single-arg/expected.js index 349be59486..374feff578 100644 --- a/test/fixtures/transformation/es6-spread/method-call-single-arg/expected.js +++ b/test/fixtures/transformation/es6-spread/method-call-single-arg/expected.js @@ -1,7 +1,5 @@ "use strict"; -var _toArray = function (arr) { - return Array.isArray(arr) ? arr : Array.from(arr); -}; +var _toArray = function (arr) { return Array.isArray(arr) ? arr : Array.from(arr); }; -add.apply(undefined, _toArray(numbers)); +add.apply(undefined, _toArray(numbers)); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-spread/new-expression/expected.js b/test/fixtures/transformation/es6-spread/new-expression/expected.js index 53d1ac3d0a..b421806bf8 100644 --- a/test/fixtures/transformation/es6-spread/new-expression/expected.js +++ b/test/fixtures/transformation/es6-spread/new-expression/expected.js @@ -1,16 +1,8 @@ "use strict"; -var _applyConstructor = function (Constructor, args) { - var instance = Object.create(Constructor.prototype); +var _applyConstructor = function (Constructor, args) { var instance = Object.create(Constructor.prototype); var result = Constructor.apply(instance, args); return result != null && (typeof result == "object" || typeof result == "function") ? result : instance; }; - var result = Constructor.apply(instance, args); - - return result != null && (typeof result == "object" || typeof result == "function") ? result : instance; -}; - -var _toArray = function (arr) { - return Array.isArray(arr) ? arr : Array.from(arr); -}; +var _toArray = function (arr) { return Array.isArray(arr) ? arr : Array.from(arr); }; _applyConstructor(Numbers, _toArray(nums)); -_applyConstructor(Numbers, [1].concat(_toArray(nums))); +_applyConstructor(Numbers, [1].concat(_toArray(nums))); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-spread/single/expected.js b/test/fixtures/transformation/es6-spread/single/expected.js index d928b5e845..374e9cbd25 100644 --- a/test/fixtures/transformation/es6-spread/single/expected.js +++ b/test/fixtures/transformation/es6-spread/single/expected.js @@ -1,7 +1,5 @@ "use strict"; -var _toArray = function (arr) { - return Array.isArray(arr) ? arr : Array.from(arr); -}; +var _toArray = function (arr) { return Array.isArray(arr) ? arr : Array.from(arr); }; -[].concat(_toArray(foo)); +[].concat(_toArray(foo)); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-template-literals/tag-loose/expected.js b/test/fixtures/transformation/es6-template-literals/tag-loose/expected.js index 7be77f1baa..2a42c708b7 100644 --- a/test/fixtures/transformation/es6-template-literals/tag-loose/expected.js +++ b/test/fixtures/transformation/es6-template-literals/tag-loose/expected.js @@ -1,8 +1,5 @@ "use strict"; -var _taggedTemplateLiteralLoose = function (strings, raw) { - strings.raw = raw; - return strings; -}; +var _taggedTemplateLiteralLoose = function (strings, raw) { strings.raw = raw; return strings; }; -var foo = bar(_taggedTemplateLiteralLoose(["wow\na", "b ", ""], ["wow\\na", "b ", ""]), 42, _.foobar()); +var foo = bar(_taggedTemplateLiteralLoose(["wow\na", "b ", ""], ["wow\\na", "b ", ""]), 42, _.foobar()); \ No newline at end of file diff --git a/test/fixtures/transformation/es6-template-literals/tag/expected.js b/test/fixtures/transformation/es6-template-literals/tag/expected.js index c4b5cb6cbb..d572423296 100644 --- a/test/fixtures/transformation/es6-template-literals/tag/expected.js +++ b/test/fixtures/transformation/es6-template-literals/tag/expected.js @@ -1,11 +1,5 @@ "use strict"; -var _taggedTemplateLiteral = function (strings, raw) { - return Object.freeze(Object.defineProperties(strings, { - raw: { - value: Object.freeze(raw) - } - })); -}; +var _taggedTemplateLiteral = function (strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }; -var foo = bar(_taggedTemplateLiteral(["wow\na", "b ", ""], ["wow\\na", "b ", ""]), 42, _.foobar()); +var foo = bar(_taggedTemplateLiteral(["wow\na", "b ", ""], ["wow\\na", "b ", ""]), 42, _.foobar()); \ No newline at end of file diff --git a/test/fixtures/transformation/es7-object-spread/assignment/expected.js b/test/fixtures/transformation/es7-object-spread/assignment/expected.js index 5671a88356..a9f914b17f 100644 --- a/test/fixtures/transformation/es7-object-spread/assignment/expected.js +++ b/test/fixtures/transformation/es7-object-spread/assignment/expected.js @@ -1,14 +1,5 @@ "use strict"; -var _extends = function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) { - target[key] = source[key]; - } - } +var _extends = function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { target[key] = source[key]; } } return target; }; - return target; -}; - -z = _extends({ x: x }, y); +z = _extends({ x: x }, y); \ No newline at end of file diff --git a/test/fixtures/transformation/es7-object-spread/expression/expected.js b/test/fixtures/transformation/es7-object-spread/expression/expected.js index 6080159f0f..a82701d91d 100644 --- a/test/fixtures/transformation/es7-object-spread/expression/expected.js +++ b/test/fixtures/transformation/es7-object-spread/expression/expected.js @@ -1,14 +1,5 @@ "use strict"; -var _extends = function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) { - target[key] = source[key]; - } - } +var _extends = function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { target[key] = source[key]; } } return target; }; - return target; -}; - -_extends({ x: x }, y, { a: a }, b, { c: c }); +_extends({ x: x }, y, { a: a }, b, { c: c }); \ No newline at end of file diff --git a/test/fixtures/transformation/es7-object-spread/variable-declaration/expected.js b/test/fixtures/transformation/es7-object-spread/variable-declaration/expected.js index 8fee368e87..4e1c04b252 100644 --- a/test/fixtures/transformation/es7-object-spread/variable-declaration/expected.js +++ b/test/fixtures/transformation/es7-object-spread/variable-declaration/expected.js @@ -1,14 +1,5 @@ "use strict"; -var _extends = function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) { - target[key] = source[key]; - } - } +var _extends = function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { target[key] = source[key]; } } return target; }; - return target; -}; - -var z = _extends({}, x); +var z = _extends({}, x); \ No newline at end of file diff --git a/test/fixtures/transformation/playground/object-getter-memoization/expected.js b/test/fixtures/transformation/playground/object-getter-memoization/expected.js index e2e8268d7d..9e2e5d2c95 100644 --- a/test/fixtures/transformation/playground/object-getter-memoization/expected.js +++ b/test/fixtures/transformation/playground/object-getter-memoization/expected.js @@ -1,18 +1,8 @@ "use strict"; -var _prototypeProperties = function (child, staticProps, instanceProps) { - if (staticProps) Object.defineProperties(child, staticProps); - if (instanceProps) Object.defineProperties(child.prototype, instanceProps); -}; +var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; -var _defineProperty = function (obj, key, value) { - return Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); -}; +var _defineProperty = function (obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); }; var Foo = (function () { function Foo() {} @@ -50,4 +40,4 @@ var foo = Object.defineProperties({}, _defineProperty({ }, enumerable: true, configurable: true -})); +})); \ No newline at end of file diff --git a/test/fixtures/transformation/source-maps/class/expected.js b/test/fixtures/transformation/source-maps/class/expected.js index 7d47f3983d..6a590a6eba 100644 --- a/test/fixtures/transformation/source-maps/class/expected.js +++ b/test/fixtures/transformation/source-maps/class/expected.js @@ -1,9 +1,6 @@ "use strict"; -var _prototypeProperties = function (child, staticProps, instanceProps) { - if (staticProps) Object.defineProperties(child, staticProps); - if (instanceProps) Object.defineProperties(child.prototype, instanceProps); -}; +var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; var Test = (function () { function Test() {} @@ -22,4 +19,4 @@ var Test = (function () { })(); 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 8b95905776..5d8c4d8816 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": 10 }, "generated": { - "line": 14, + "line": 11, "column": 15 } }] diff --git a/test/fixtures/transformation/spec-proto-to-assign/assignment-expression/expected.js b/test/fixtures/transformation/spec-proto-to-assign/assignment-expression/expected.js index 9de37223a2..bbab18ef80 100644 --- a/test/fixtures/transformation/spec-proto-to-assign/assignment-expression/expected.js +++ b/test/fixtures/transformation/spec-proto-to-assign/assignment-expression/expected.js @@ -1,18 +1,10 @@ "use strict"; var _foo, _foo$bar, _foo$bar2; -var _defaults = function (obj, defaults) { - for (var key in defaults) { - if (obj[key] === undefined) { - obj[key] = defaults[key]; - } - } - - return obj; -}; +var _defaults = function (obj, defaults) { for (var key in defaults) { if (obj[key] === undefined) { obj[key] = defaults[key]; } } return obj; }; console.log((_foo = foo, _defaults(_foo, bar), _foo)); console.log((_foo$bar = foo[bar], _defaults(_foo$bar, bar), _foo$bar)); -console.log((_foo$bar2 = foo[bar()], _defaults(_foo$bar2, bar), _foo$bar2)); +console.log((_foo$bar2 = foo[bar()], _defaults(_foo$bar2, bar), _foo$bar2)); \ No newline at end of file diff --git a/test/fixtures/transformation/spec-proto-to-assign/assignment-statement/expected.js b/test/fixtures/transformation/spec-proto-to-assign/assignment-statement/expected.js index 10b661e74f..26d5cc5673 100644 --- a/test/fixtures/transformation/spec-proto-to-assign/assignment-statement/expected.js +++ b/test/fixtures/transformation/spec-proto-to-assign/assignment-statement/expected.js @@ -1,13 +1,5 @@ "use strict"; -var _defaults = function (obj, defaults) { - for (var key in defaults) { - if (obj[key] === undefined) { - obj[key] = defaults[key]; - } - } +var _defaults = function (obj, defaults) { for (var key in defaults) { if (obj[key] === undefined) { obj[key] = defaults[key]; } } return obj; }; - return obj; -}; - -_defaults(obj, bar); +_defaults(obj, bar); \ No newline at end of file diff --git a/test/fixtures/transformation/spec-proto-to-assign/class/expected.js b/test/fixtures/transformation/spec-proto-to-assign/class/expected.js index 6b9561e3e7..cec2fa5ac4 100644 --- a/test/fixtures/transformation/spec-proto-to-assign/class/expected.js +++ b/test/fixtures/transformation/spec-proto-to-assign/class/expected.js @@ -1,29 +1,8 @@ "use strict"; -var _defaults = function (obj, defaults) { - for (var key in defaults) { - if (obj[key] === undefined) { - obj[key] = defaults[key]; - } - } +var _defaults = function (obj, defaults) { for (var key in defaults) { if (obj[key] === undefined) { obj[key] = defaults[key]; } } return obj; }; - return obj; -}; - -var _inherits = function (subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); - } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - enumerable: false, - writable: true, - configurable: true - } - }); - if (superClass) _defaults(subClass, superClass); -}; +var _inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) _defaults(subClass, superClass); }; var Foo = (function (Bar) { function Foo() { @@ -35,4 +14,4 @@ var Foo = (function (Bar) { _inherits(Foo, Bar); return Foo; -})(Bar); +})(Bar); \ No newline at end of file diff --git a/test/fixtures/transformation/spec-proto-to-assign/object-literal/expected.js b/test/fixtures/transformation/spec-proto-to-assign/object-literal/expected.js index 49087a66e7..fb68c44833 100644 --- a/test/fixtures/transformation/spec-proto-to-assign/object-literal/expected.js +++ b/test/fixtures/transformation/spec-proto-to-assign/object-literal/expected.js @@ -1,15 +1,6 @@ "use strict"; -var _extends = function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) { - target[key] = source[key]; - } - } - - return target; -}; +var _extends = function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { target[key] = source[key]; } } return target; }; var foo = _extends({}, bar); @@ -18,4 +9,4 @@ var foo = _extends({}, bar, { var foo = _extends({}, bar, { bar: "foo" -}); +}); \ No newline at end of file diff --git a/test/fixtures/transformation/spec-typeof-symbol/basic/expected.js b/test/fixtures/transformation/spec-typeof-symbol/basic/expected.js index a93f2923c6..1fda755031 100644 --- a/test/fixtures/transformation/spec-typeof-symbol/basic/expected.js +++ b/test/fixtures/transformation/spec-typeof-symbol/basic/expected.js @@ -1,8 +1,6 @@ "use strict"; -var _typeof = function (obj) { - return obj && obj.constructor === Symbol ? "symbol" : typeof obj; -}; +var _typeof = function (obj) { return obj && obj.constructor === Symbol ? "symbol" : typeof obj; }; var s = Symbol("s"); -assert.equal(typeof s === "undefined" ? "undefined" : _typeof(s), "symbol"); +assert.equal(typeof s === "undefined" ? "undefined" : _typeof(s), "symbol"); \ No newline at end of file