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

TypeError on IE, System.registry.entries() not defined in case of undefined Symbol or Symbol.iterator #43

Closed
reinholdk opened this Issue Sep 15, 2017 · 6 comments

Comments

Projects
None yet
2 participants
@reinholdk

reinholdk commented Sep 15, 2017

I'm submitting a bug report

  • Library Version:
    1.0.2

Please tell us about your environment:

  • Operating System:
    Windows 10

  • Node Version:
    7.8.0

  • NPM Version:
    4.0.5

  • JSPM OR Webpack AND Version
    JSPM 0.17.0-beta.41

  • Browser:
    IE 11

  • Language:
    ESNext

Current behavior:
A type error occurs on IE11: Object doesn't support property or method 'entries'

for (let [k, m] of System.registry.entries()) {

Expected/desired behavior:

  • What is the expected behavior?
    Do not use Object.entries() or provide a polyfill in aurelia-polyfills

  • What is the motivation / use case for changing the behavior?
    Do not require external polyfills when using aurelia libraries.

@StrahilKazlachev

This comment has been minimized.

Show comment
Hide comment
@StrahilKazlachev

StrahilKazlachev Sep 15, 2017

Contributor

You have this wrong. This is not Object.entries, it's Map.prototype.entries. System.registry is a Map.

Contributor

StrahilKazlachev commented Sep 15, 2017

You have this wrong. This is not Object.entries, it's Map.prototype.entries. System.registry is a Map.

@StrahilKazlachev

This comment has been minimized.

Show comment
Hide comment
@StrahilKazlachev

StrahilKazlachev Sep 15, 2017

Contributor

Then we should be able to just use for instead of for of.
Now I'm more curious about the Error, System.registry.entries should be there regardless of polyfills. And I don't see any other .entries in the transpiled code.

Contributor

StrahilKazlachev commented Sep 15, 2017

Then we should be able to just use for instead of for of.
Now I'm more curious about the Error, System.registry.entries should be there regardless of polyfills. And I don't see any other .entries in the transpiled code.

@StrahilKazlachev

This comment has been minimized.

Show comment
Hide comment
@StrahilKazlachev

StrahilKazlachev Sep 15, 2017

Contributor

OK, so Registry.prototype.entries is only available if there is an iterator support - we should do with .keys and .values only.
aurelia-polyfills does add Symbol and Symbol.iterator, but this is after SystemJS is loaded, so Registry.prototype.entries is not added. .keys and .values do work since they get added regardless and have runtime checks for iterator support - aurelia-polyfills is loaded at this time.
aurelia-polyfills does need a module loader so you can't load it before SystemJS.

Contributor

StrahilKazlachev commented Sep 15, 2017

OK, so Registry.prototype.entries is only available if there is an iterator support - we should do with .keys and .values only.
aurelia-polyfills does add Symbol and Symbol.iterator, but this is after SystemJS is loaded, so Registry.prototype.entries is not added. .keys and .values do work since they get added regardless and have runtime checks for iterator support - aurelia-polyfills is loaded at this time.
aurelia-polyfills does need a module loader so you can't load it before SystemJS.

@reinholdk

This comment has been minimized.

Show comment
Hide comment
@reinholdk

reinholdk Sep 15, 2017

Exactly, typeof Symbol is undefined at the time SystemJS is loaded, i.e. System.registry.entries does not get defined on IE.

reinholdk commented Sep 15, 2017

Exactly, typeof Symbol is undefined at the time SystemJS is loaded, i.e. System.registry.entries does not get defined on IE.

@StrahilKazlachev

This comment has been minimized.

Show comment
Hide comment
@StrahilKazlachev

StrahilKazlachev Sep 15, 2017

Contributor

@reinholdk Do you mind editing the title and content to reflect that this is not an issue with Object.entries, but with Symbol and Symbol.iterator.

Contributor

StrahilKazlachev commented Sep 15, 2017

@reinholdk Do you mind editing the title and content to reflect that this is not an issue with Object.entries, but with Symbol and Symbol.iterator.

@reinholdk reinholdk changed the title from TypeError on IE, missing polyfill for Object.entries() to TypeError on IE, System.registry.entries() not defined in case of undefined Symbol or Symbol.iterator Sep 15, 2017

EisenbergEffect added a commit that referenced this issue Oct 1, 2017

Merge pull request #44 from StrahilKazlachev/fix/SystemJS-0.20.x/IE11
fix(index): use .keys instead of .entries close #43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment