src/Util.js
function (target, firstSource) {
    if (target === undefined || target === null) {
      throw new TypeError('Cannot convert first argument to object');
    }

    var to = Object(target);

    var hasPendingException = false;
    var pendingException;

    for (var i = 1; i < arguments.length; i++) {
      var nextSource = arguments[i];
      if (nextSource === undefined || nextSource === null)
        continue;

      var keysArray = Object.keys(Object(nextSource));
      for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) {
        var nextKey = keysArray[nextIndex];
        try {
          var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
          if (desc !== undefined && desc.enumerable)
            to[nextKey] = nextSource[nextKey];
        } catch (e) {
          if (!hasPendingException) {
            hasPendingException = true;
            pendingException = e;
          }
        }
      }

      if (hasPendingException)
        throw pendingException;
    }
    return to;
  }
function (target, firstSource) {
    if (target === undefined || target === null) {
      throw new TypeError('Cannot convert first argument to object');
    }

    var to = Object(target);

    var hasPendingException = false;
    var pendingException;

    for (var i = 1; i < arguments.length; i++) {
      var nextSource = arguments[i];
      if (nextSource === undefined || nextSource === null)
        continue;

      var keysArray = Object.keys(Object(nextSource));
      for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) {
        var nextKey = keysArray[nextIndex];
        try {
          var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
          if (desc !== undefined && desc.enumerable)
            to[nextKey] = nextSource[nextKey];
        } catch (e) {
          if (!hasPendingException) {
            hasPendingException = true;
            pendingException = e;
          }
        }
      }

      if (hasPendingException)
        throw pendingException;
    }
    return to;
  }
function ( target , firstSource ) { if ( target === undefined || target === null ) { throw new TypeError ( 'Cannot convert first argument to object' ) ; } var to = Object ( target ) ; var hasPendingException = false ; var pendingException ; for ( var i = 1 ; i < arguments . length ; i ++ ) { var nextSource = arguments [ i ] ; if ( nextSource === undefined || nextSource === null ) continue ; var keysArray = Object . keys ( Object ( nextSource ) ) ; for ( var nextIndex = 0 , len = keysArray . length ; nextIndex < len ; nextIndex ++ ) { var nextKey = keysArray [ nextIndex ] ; try { var desc = Object . getOwnPropertyDescriptor ( nextSource , nextKey ) ; if ( desc !== undefined && desc . enumerable ) to [ nextKey ] = nextSource [ nextKey ] ; } catch ( e ) { if ( ! hasPendingException ) { hasPendingException = true ; pendingException = e ; } } } if ( hasPendingException ) throw pendingException ; } return to ; }
ES6 Object.assign.
@see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
ES6 Object . assign .