Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Current version doesn't support IE11 #18

Closed
sunknudsen opened this issue May 12, 2018 · 4 comments
Closed

Current version doesn't support IE11 #18

sunknudsen opened this issue May 12, 2018 · 4 comments

Comments

@sunknudsen
Copy link
Contributor

Adding IE11 support appears to be very easy.

It is achieved by replacing the Object.assign call found here by a call to the following ponyfill.

This ponyfill is inspired by the following polyfill by Mozilla.

function objectAssign(target, varArgs) {
  if (target == null) {
    throw new TypeError('Cannot convert undefined or null to object');
  }
  var to = Object(target);
  for (var index = 1; index < arguments.length; index++) {
    var nextSource = arguments[index];
    if (nextSource != null) {
      for (var nextKey in nextSource) {
        if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
          to[nextKey] = nextSource[nextKey];
        }
      }
    }
  }
  return to;
}
@MatthewCallis
Copy link
Owner

I didn't want to include a polyfill directly in the code when it can be conditionally added by whatever build tool like Polyfill.io or mdn-polyfills with import 'mdn-polyfills/Object.assign'; // 317 bytes. I will just let Babel handle it and use object-spread instead. I will work on a PR and some other updates, but until then one of those options should work immediately.

@sunknudsen
Copy link
Contributor Author

Thanks Matthew

@MatthewCallis
Copy link
Owner

The new version uses spread and should work fine in IE11 since it went through Babel!

@sunknudsen
Copy link
Contributor Author

Thanks @MatthewCallis. I confirm version 4.0.0 works in IE 11. Good work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants