From e1816607b3940a77a94b4646e57f968fce98463f Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Mon, 12 Jun 2017 19:46:08 +0100 Subject: [PATCH] Use Object.assign polyfill for update addon (#9932) --- addons/react-addons-update/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/react-addons-update/index.js b/addons/react-addons-update/index.js index 06cdbbcaf53f..ad2e897ddc74 100644 --- a/addons/react-addons-update/index.js +++ b/addons/react-addons-update/index.js @@ -9,6 +9,7 @@ 'use strict'; +var _assign = require('object-assign'); var invariant = require('fbjs/lib/invariant'); var hasOwnProperty = {}.hasOwnProperty; @@ -16,7 +17,7 @@ function shallowCopy(x) { if (Array.isArray(x)) { return x.concat(); } else if (x && typeof x === 'object') { - return Object.assign(new x.constructor(), x); + return _assign(new x.constructor(), x); } else { return x; } @@ -100,7 +101,7 @@ function update(value, spec) { COMMAND_MERGE, nextValue ); - Object.assign(nextValue, spec[COMMAND_MERGE]); + _assign(nextValue, spec[COMMAND_MERGE]); } if (hasOwnProperty.call(spec, COMMAND_PUSH)) {