compatible.js 663 B

1234567891011121314151617181920
  1. if (typeof Object.assign != 'function') {
  2. Object.assign = function(target) {
  3. 'use strict';
  4. if (target == null) {
  5. throw new TypeError('Cannot convert undefined or null to object');
  6. }
  7. target = Object(target);
  8. for (var index = 1; index < arguments.length; index++) {
  9. var source = arguments[index];
  10. if (source != null) {
  11. for (var key in source) {
  12. if (Object.prototype.hasOwnProperty.call(source, key)) {
  13. target[key] = source[key];
  14. }
  15. }
  16. }
  17. }
  18. return target;
  19. };
  20. }