object.assign.js 921 B

1234567891011121314151617181920212223242526272829303132333435
  1. /**
  2. * DO NOT EDIT THIS FILE.
  3. * See the following change record for more information,
  4. * https://www.drupal.org/node/2815083
  5. * @preserve
  6. **/
  7. if (typeof Object.assign !== 'function') {
  8. Object.defineProperty(Object, 'assign', {
  9. value: function assign(target, varArgs) {
  10. 'use strict';
  11. if (target === null || target === undefined) {
  12. throw new TypeError('Cannot convert undefined or null to object');
  13. }
  14. var to = Object(target);
  15. for (var index = 1; index < arguments.length; index++) {
  16. var nextSource = arguments[index];
  17. if (nextSource !== null && nextSource !== undefined) {
  18. for (var nextKey in nextSource) {
  19. if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
  20. to[nextKey] = nextSource[nextKey];
  21. }
  22. }
  23. }
  24. }
  25. return to;
  26. },
  27. writable: true,
  28. configurable: true
  29. });
  30. }