Fable icon indicating copy to clipboard operation
Fable copied to clipboard

[JS/TS] `[<AttachMembers>]` removes comments from functions

Open Freymaurer opened this issue 6 months ago • 0 comments

repl

Without [<AttachMembers>]:


/**
 * Hello!
 */
export function ArcTable__TellMeYourName(this$) {
    const arg = ArcTable__get_name(this$);
    toConsole(printf("Hello, i am %A!"))(arg);
}

With:

export class ArcTable {
    constructor(name) {
        this["name@"] = name;
    }
    get name() {
        const __ = this;
        return __["name@"];
    }
    set name(v) {
        const __ = this;
        __["name@"] = v;
    }
    TellMeYourName() {
        const this$ = this;
        const arg = this$.name;
        toConsole(printf("Hello, i am %A!"))(arg);
    }
}

Expected:

export class ArcTable2 {
    "name@": string;
    constructor(name: string) {
        this["name@"] = name;
    }
    get name(): string {
        const __: ArcTable = this;
        return __["name@"];
    }
    set name(v: string) {
        const __: ArcTable = this;
        __["name@"] = v;
    }
    /**
     * Hello!
     */
    TellMeYourName(): void {
        const this$: ArcTable = this;
        const arg: string = this$.name;
        toConsole(printf("Hello, i am %A!"))(arg);
    }
}

Freymaurer avatar Jun 12 '25 09:06 Freymaurer