Skip to content

Bug with private fields: comment emitted twice #26

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

Closed
mheiber opened this issue Jan 14, 2019 · 1 comment
Closed

Bug with private fields: comment emitted twice #26

mheiber opened this issue Jan 14, 2019 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@mheiber
Copy link

mheiber commented Jan 14, 2019

Actual behavior: comment is emitted above the class and inside the constructor
Expected behavior: comment is only emitted above the class

TS:

// i am a comment

class A {
    #b: string = "FFF"
    constructor (public name: string) {
    }
}

JS emit:

// i am a comment
var _classPrivateFieldSet = function (receiver, privateMap, value) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to set private field on non-instance"); } privateMap.set(receiver, value); return value; };
var _b_1;
"use strict";
class A {
    constructor(name) {
        // i am a comment
        _b_1.set(this, void 0);
        this.name = name;
        _classPrivateFieldSet(this, _b_1, "FFF");
    }
}
_b_1 = new WeakMap();
@joeywatts joeywatts self-assigned this Jan 23, 2019
@joeywatts joeywatts added the bug Something isn't working label Jan 23, 2019
@mheiber
Copy link
Author

mheiber commented Jan 24, 2019

Fixed! Nice job @joeywatts

@mheiber mheiber closed this as completed Jan 24, 2019
mheiber pushed a commit to mheiber/TypeScript that referenced this issue Sep 4, 2019
…icrosoft#32519)

* Strip more kinds of timestamps and versions from dockerfile output, rewrite office-ui-fabric dockerfile to use new lerna build system

* Add another filter for just output

* Update user baselines (bloomberg#23)

* Update user baselines (bloomberg#24)

* Strip only maybe-present timestamps

* More lenient timestamp filter

* Update user baselines (bloomberg#25)

* Simplify and enhance vscode dockerfile to use nightly ts in ts extension, too

* Update user baselines (bloomberg#26)

* Update user baselines (bloomberg#27)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants