function extend(target, var_args) {
  let key;
  let source;
  for (let i = 1; i < arguments.length; i++) {
    source = arguments[i];
    for (key in source) {
      target[key] = source[key];
    }

    // For IE the for-in-loop does not contain any properties that are not
    // enumerable on the prototype object (for example isPrototypeOf from
    // Object.prototype) and it will also not include 'replace' on objects that
    // extend String and change 'replace' (not that it is common for anyone to
    // extend anything except Object).

    for (let j = 0; j < PROTOTYPE_FIELDS.length; j++) {
      key = PROTOTYPE_FIELDS[j];
      if (Object.prototype.hasOwnProperty.call(source, key)) {
        target[key] = source[key];
      }
    }
  }
}
Extends an object with another object.
This operates 'in-place'; it does not create a new Object.
Example:
var o = {};
extend(o, {a: 0, b: 1});
o; // {a: 0, b: 1}
extend(o, {b: 2, c: 3});
o; // {a: 0, b: 2, c: 3}
@param {?Object} target The object to modify. Existing properties will be
    overwritten if they are also present in one of the objects in `var_args`.
@param {...(?Object|undefined)} var_args The objects from which values
    will be copied.
@return {void}
@deprecated Prefer Object.assign