loganfsmyth / babel-plugin-transform-decorators-legacy

A plugin for Babel 6 that (mostly) replicates the old decorator behavior from Babel 5
MIT License
817 stars 57 forks source link

Fix for static properties that are instance of the container class. #56

Open Azatey opened 7 years ago

Azatey commented 7 years ago

Trying to create singleton class with static property with instance of the container class will fail due to incorrect transformations:

class Foo {
    static instance = new Foo();
}

will become:

let Foo = class Foo {
    static instance = new Foo(); // Here Foo is not a constructor
}