diff --git a/lib/6to5/transformation/templates/extends.js b/lib/6to5/transformation/templates/extends.js index 28ce3d1c86..89cff6502b 100644 --- a/lib/6to5/transformation/templates/extends.js +++ b/lib/6to5/transformation/templates/extends.js @@ -2,7 +2,7 @@ for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { - if (Object.prototype.hasOwnProperty.call(target, key)) { + if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } diff --git a/test/fixtures/transformation/es7-object-spread/assignment/expected.js b/test/fixtures/transformation/es7-object-spread/assignment/expected.js index 7d076b5fa2..7768f0f858 100644 --- a/test/fixtures/transformation/es7-object-spread/assignment/expected.js +++ b/test/fixtures/transformation/es7-object-spread/assignment/expected.js @@ -1,5 +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) { if (Object.prototype.hasOwnProperty.call(target, key)) { 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) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; z = _extends({ x: x }, y); diff --git a/test/fixtures/transformation/es7-object-spread/expression/expected.js b/test/fixtures/transformation/es7-object-spread/expression/expected.js index 8e822f2337..f2671698d9 100644 --- a/test/fixtures/transformation/es7-object-spread/expression/expected.js +++ b/test/fixtures/transformation/es7-object-spread/expression/expected.js @@ -1,5 +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) { if (Object.prototype.hasOwnProperty.call(target, key)) { 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) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; _extends({ x: x }, y, { a: a }, b, { c: c }); 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 dd5ceb4b70..ceb256a198 100644 --- a/test/fixtures/transformation/es7-object-spread/variable-declaration/expected.js +++ b/test/fixtures/transformation/es7-object-spread/variable-declaration/expected.js @@ -1,5 +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) { if (Object.prototype.hasOwnProperty.call(target, key)) { 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) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var z = _extends({}, x); diff --git a/test/fixtures/transformation/react/adds-appropriate-newlines-when-using-spread-attribute/expected.js b/test/fixtures/transformation/react/adds-appropriate-newlines-when-using-spread-attribute/expected.js index 0ab7325b6a..46962e2c4b 100644 --- a/test/fixtures/transformation/react/adds-appropriate-newlines-when-using-spread-attribute/expected.js +++ b/test/fixtures/transformation/react/adds-appropriate-newlines-when-using-spread-attribute/expected.js @@ -1,4 +1,4 @@ -var _extends = function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(target, key)) { 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) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; React.createElement(Component, _extends({}, props, { sound: "moo" })); diff --git a/test/fixtures/transformation/react/wraps-props-in-react-spread-for-first-spread-attributes/expected.js b/test/fixtures/transformation/react/wraps-props-in-react-spread-for-first-spread-attributes/expected.js index 7eca957f8b..4d3fb939fd 100644 --- a/test/fixtures/transformation/react/wraps-props-in-react-spread-for-first-spread-attributes/expected.js +++ b/test/fixtures/transformation/react/wraps-props-in-react-spread-for-first-spread-attributes/expected.js @@ -1,3 +1,3 @@ -var _extends = function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(target, key)) { 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) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; React.createElement(Component, _extends({}, x, { y: 2, z: true })); diff --git a/test/fixtures/transformation/react/wraps-props-in-react-spread-for-last-spread-attributes/expected.js b/test/fixtures/transformation/react/wraps-props-in-react-spread-for-last-spread-attributes/expected.js index 7bd941e5a5..e64b5a25f6 100644 --- a/test/fixtures/transformation/react/wraps-props-in-react-spread-for-last-spread-attributes/expected.js +++ b/test/fixtures/transformation/react/wraps-props-in-react-spread-for-last-spread-attributes/expected.js @@ -1,3 +1,3 @@ -var _extends = function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(target, key)) { 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) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; React.createElement(Component, _extends({ y: 2, z: true }, x)); diff --git a/test/fixtures/transformation/react/wraps-props-in-react-spread-for-middle-spread-attributes/expected.js b/test/fixtures/transformation/react/wraps-props-in-react-spread-for-middle-spread-attributes/expected.js index e20dde8dd5..fff0428c83 100644 --- a/test/fixtures/transformation/react/wraps-props-in-react-spread-for-middle-spread-attributes/expected.js +++ b/test/fixtures/transformation/react/wraps-props-in-react-spread-for-middle-spread-attributes/expected.js @@ -1,3 +1,3 @@ -var _extends = function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(target, key)) { 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) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; React.createElement(Component, _extends({ y: 2 }, x, { z: true })); 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 1c6fe0533f..6719a974ce 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,6 +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) { if (Object.prototype.hasOwnProperty.call(target, key)) { 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) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var foo = _extends({}, bar);