Skip to content
This repository was archived by the owner on Jul 13, 2020. It is now read-only.
This repository was archived by the owner on Jul 13, 2020. It is now read-only.

URL use errors in IE/Edge #398

Closed
Closed

Description

@jdalton

The URL constructor in IE/Edge exists but cannot be called as a constructor. So the feature inference of "function" passes and then errors out when used.

Activity

  1. guybedford commented on Jun 12, 2015

    @guybedford
    Member

    Thanks! Is there an alternative you would suggest? Is there a better way to call it in Edge?

  2. jdalton commented on Jun 12, 2015

    @jdalton
    Author

    The URL constructor is currently marked as "under consideration" on status.modern.ie. So it looks like IE/Edge's is from an earlier form of it. I think modifying the feature check from:

    var URL = typeof __global.URL == 'function' && __global.URL || URLPolyfill;

    to something like

    var URL = URLPolyfill;
    try { URL = (new __global.URL('http://')).protocol == 'http:' && __global.URL; } catch(e) {}

    should do it.

  3. guybedford commented on Jun 13, 2015

    @guybedford
    Member

    Thanks, the build in this project actually always uses the polyfill directly - it's just SystemJS that loads it as a separate step. Mainly because there is a lot of pressure to show a low footprint loader.

    Fixed this up in SystemJS at systemjs/systemjs@47d9bf0.

  4. probins commented on Jun 13, 2015

    @probins
    Contributor

    strange: according to https://developer.mozilla.org/en-US/docs/Web/API/URL#Browser_compatibility the URL constructor is supported in IE from v10. Is that not correct?

  5. jdalton commented on Jun 13, 2015

    @jdalton
    Author

    While the URL function exists, calling it as a constructor, a relatively newer addition, is not supported yet.

  6. probins commented on Jun 13, 2015

    @probins
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions