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

Subclass does not inherit static properties in IE10 #8050

Closed
dgeibi opened this issue May 25, 2018 · 3 comments
Closed

Subclass does not inherit static properties in IE10 #8050

dgeibi opened this issue May 25, 2018 · 3 comments
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@dgeibi
Copy link

dgeibi commented May 25, 2018

Bug Report

Current Behavior

can't access superClass's static properties by subClass in IE10

repo: https://github.com/dgeibi/babel7-ie10-class-inheritance-bug
demo: https://dgeibi.github.io/babel7-ie10-class-inheritance-bug/

Input Code

https://github.com/dgeibi/babel7-ie10-class-inheritance-bug/blob/master/src/index.js

Expected behavior/code

Static methods inheritance works in IE10.

Babel Configuration (.babelrc, package.json, cli command)

{
  "presets": [
    ["@babel/preset-env", {
      "modules": false,
      "useBuiltins": "usage"
    }]
  ],
  "plugins": [
    "@babel/plugin-transform-runtime"
  ]
}

Environment

  • Babel version(s): v7.0.0-beta.48
  • Node/npm version: Node10/npm6
  • OS: Windows 10
  • Monorepo no
  • How you are using Babel: loader

Possible Solution

add polyfill for setPrototypeOf

repo: https://github.com/dgeibi/babel7-ie10-class-inheritance-bug/blob/master/docs/workaround.html
demo: https://dgeibi.github.io/babel7-ie10-class-inheritance-bug/workaround.html

Additional context/Screenshots

expected:
expected

IE10 without workaround:
bug

@babel-bot
Copy link
Collaborator

Hey @dgeibi! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community that typically always has someone willing to help. You can sign-up here
for an invite.

@dgeibi
Copy link
Author

dgeibi commented May 25, 2018

If .babelrc is

{
  "presets": [
    ["@babel/preset-env", {
      "modules": false,
      "useBuiltins": "usage"
    }]
  ],
  "plugins": [
    "@babel/plugin-transform-proto-to-assign"
  ]
}

In IE10, result will be

assign

@dgeibi dgeibi changed the title On IE 10, class inheritance don't support "static methods" Subclass does not inherit static properties in IE10 May 25, 2018
@dgeibi
Copy link
Author

dgeibi commented May 27, 2018

I have figured out that it's very difficult to support Object.setPrototypeOf fully in IE10.

related: #2450

@dgeibi dgeibi closed this as completed May 27, 2018
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Aug 26, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Aug 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

No branches or pull requests

2 participants