Ajaxinate icon indicating copy to clipboard operation
Ajaxinate copied to clipboard

IE Object.assign not available

Open stanleynguyen opened this issue 4 years ago • 1 comments

Object.assign is not available on IE. The fix is simple as only a polyfill is necessary

if (typeof Object.assign != 'function') {
  Object.assign = function(target) {
    'use strict';
    if (target == null) {
      throw new TypeError('Cannot convert undefined or null to object');
    }

    target = Object(target);
    for (var index = 1; index < arguments.length; index++) {
      var source = arguments[index];
      if (source != null) {
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
    }
    return target;
  };
}

stanleynguyen avatar Oct 28 '19 15:10 stanleynguyen

@stanleynguyen nice one. Personally I don't think we should change the package to support IE. But I'd like to keep this issue open, and possible pinned, so that others can implement support for IE as necessary.

Cam avatar Nov 13 '19 23:11 Cam