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

Object.assign window.location in IE11 Bug #17

Closed
taddei opened this issue Sep 21, 2018 · 5 comments
Closed

Object.assign window.location in IE11 Bug #17

taddei opened this issue Sep 21, 2018 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@taddei
Copy link

taddei commented Sep 21, 2018

It looks like in IE11, trying to do the following results in an error.

Object.assign({}, window.location)

This pattern is currently used by https://github.com/reach/router for example, breaking our pages in IE11

I've created a JSBin to highlight the issue

https://jsbin.com/yigocowero/1/edit?html,console

@ephor
Copy link

ephor commented Nov 2, 2018

I have same issue

@ephor
Copy link

ephor commented Nov 2, 2018

I found that if the window.location put as first argument, then everything works

Object.assign(window.location, {})

Also, if i change function that provided by polyfill-service to function that provided by babel, everything works too.

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

@JakeChampion
Copy link
Owner

Thanks for the excellent bug report, it is great to see a reproducible test case.

Looking into this it is also broken with the latest version of the service, I was hoping the new polyfill would have fixed it.

I'll have to set aside some time to find the root cause.

@JakeChampion JakeChampion transferred this issue from polyfillpolyfill/polyfill-service Jan 22, 2019
@taddei
Copy link
Author

taddei commented Jan 22, 2019

Thanks for looking into it. We had to disable Object.assign from polyfill.io and hardcode it for all users.

Not ideal but it works

@JakeChampion JakeChampion added the bug Something isn't working label Jan 22, 2019
@JakeChampion JakeChampion self-assigned this Jan 22, 2019
@JakeChampion
Copy link
Owner

This was fixed in #155 and published in https://github.com/Financial-Times/polyfill-library/releases/tag/v3.32.0

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants