react / wstein / node_modules / react / node_modules / envify / node_modules / jstransform / polyfill / Object.es6.js
80542 views/**1* Copyright 2014 Facebook, Inc.2*3* Licensed under the Apache License, Version 2.0 (the "License");4* you may not use this file except in compliance with the License.5* You may obtain a copy of the License at6*7* http://www.apache.org/licenses/LICENSE-2.08*9* Unless required by applicable law or agreed to in writing, software10* distributed under the License is distributed on an "AS IS" BASIS,11* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12* See the License for the specific language governing permissions and13* limitations under the License.14*15* @provides Object.es616* @polyfill17*/1819// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign2021if (!Object.assign) {22Object.assign = function(target, sources) {23if (target === null || target === undefined) {24throw new TypeError('Object.assign target cannot be null or undefined');25}2627var to = Object(target);28var hasOwnProperty = Object.prototype.hasOwnProperty;2930for (var nextIndex = 1; nextIndex < arguments.length; nextIndex++) {31var nextSource = arguments[nextIndex];32if (nextSource === null || nextSource === undefined) {33continue;34}3536var from = Object(nextSource);3738// We don't currently support accessors nor proxies. Therefore this39// copy cannot throw. If we ever supported this then we must handle40// exceptions and side-effects.4142for (var key in from) {43if (hasOwnProperty.call(from, key)) {44to[key] = from[key];45}46}47}4849return to;50};51}525354