-
-
Notifications
You must be signed in to change notification settings - Fork 688
Open
Description
I am working on a library written in Haxe and compiled to JS. I have everything working pretty well but have run into this. The generated code for a class (even in ES6 mode) always looks like:
class Thing {
}
Thing.__name__ = "Thing";
Object.assign(Thing.prototype, {
__class__: Thing
,thing: null
});
This top-level mutation prevents tree shaking of the class no matter how I set up my imports. removing these lines after the class fixes it for me but of course I'm not sure that safe to do. It seems like this should be equivalent to:
class Thing {
static __name__ = "Thing";
__class__ = Thing;
thing = null;
}
perhaps ES6 mode could generate this modern syntax instead?
Metadata
Metadata
Assignees
Labels
No labels