LoginSignup
3
2

More than 5 years have passed since last update.

babel で継承元の static メソッドを IE9 でも使用する方法

Last updated at Posted at 2016-01-07

あくまでも使用するだけで、polyfill とかじゃないです。
そうです。無理矢理です。
もう普通に継承先に書いちまえって感じだけど、どうしてもって場合に。

class Pearent {
  static test() {
    console.log(this);
  }
}

class Child extends Pearent {
  static test() {
    return this.__proto__.test.call(this);
  }
}

Child.test();
  • call 使ってる理由が分かりやすいように this を出力するように変更(2016/1/8)

というか、どうにかして出来るんじゃないかとは思うけど、
今のトコロわかんないので、とりあえず。

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2