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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃 Cherry-pick PR #34987 into release-3.7 #35303

Merged

Commits on Nov 22, 2019

  1. Cherry-pick PR microsoft#34987 into release-3.7

    Component commits:
    5810765 Emit defineProperty calls before param prop assignments
    Note that I restricted this to --useDefineForClassFields is true.
    Nothing changes when it's off. I think this is the correct fix for a
    patch release.
    
    However, in principal there's nothing wrong with moving parameter
    property initialisation after property declaration initialisation. It
    would be Extremely Bad and Wrong to rely on this working:
    
    ```ts
    class C {
      p = this.q // what is q?
      constructor(public q: number) { }
    }
    ```
    
    But today it does, and probably somebody relies on it without knowing.
    
    ec79590 Put parameter property initialiser into defineProperty's value
    
    be86355 Merge branch 'master' into fix-defineProperty-parameter-property-emit
    
    8ff59b9 Combine ES5/ESNext into one test
    sandersn authored and typescript-bot committed Nov 22, 2019
    Copy the full SHA
    1cb94c9 View commit details
    Browse the repository at this point in the history