forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 14
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
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();Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working