src/class/ReactClass.js
/**
 * Merge two objects, but throw if both contain the same key.
 *
 * @param {object} one The first object, which is mutated.
 * @param {object} two The second object
 * @return {object} one after it has been mutated to contain everything in two.
 */
Merge two objects, but throw if both contain the same key.
@param {object} one The first object, which is mutated.
@param {object} two The second object
@return {object} one after it has been mutated to contain everything in two.
Merge two objects but throw if both contain the same key . @param { object } one The first object which is mutated . @param { object } two The second object @return { object } one after it has been mutated to contain everything in two .
function mergeObjectsWithNoDuplicateKeys(one, two) {
  invariant(
    one && two && typeof one === 'object' && typeof two === 'object',
    'mergeObjectsWithNoDuplicateKeys(): Cannot merge non-objects'
  );
  mapObject(two, function(value, key) {
    invariant(
      one[key] === undefined,
      'mergeObjectsWithNoDuplicateKeys(): ' +
      'Tried to merge two objects with the same key: `%s`. This conflict ' +
      'may be due to a mixin; in particular, this may be caused by two ' +
      'getInitialState() or getDefaultProps() methods returning objects ' +
      'with clashing keys.',
      key
    );
    one[key] = value;
  });
  return one;
}
function mergeObjectsWithNoDuplicateKeys ( one , two ) { invariant ( one && two && typeof one === 'object' && typeof two === 'object' , 'mergeObjectsWithNoDuplicateKeys(): Cannot merge non-objects' ) ; mapObject ( two , function ( value , key ) { invariant ( one [ key ] === undefined , 'mergeObjectsWithNoDuplicateKeys(): ' + 'Tried to merge two objects with the same key: `%s`. This conflict ' + 'may be due to a mixin; in particular, this may be caused by two ' + 'getInitialState() or getDefaultProps() methods returning objects ' + 'with clashing keys.' , key ) ; one [ key ] = value ; } ) ; return one ; }
Merge two objects, but throw if both contain the same key.
Merge two objects but throw if both contain the same key .