You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The reason will be displayed to describe this comment to others. Learn more.
Meh. This means if you extend something ubiquitous as EventTarget/EventDispatcher/EventEmitter, your whole class becomes non-DCE-able. Can we have a way to opt out of this at least?
The reason will be displayed to describe this comment to others. Learn more.
Let me clarify my particular issue: this change forcibly disables DCE in a number of cases. Consider this try.haxe snippet:
classTest {
staticfunctionmain() {
trace("Haxe is great!");
}
}
//@:keepSub //<-- uncomment for the new behaviorexternclassEventTarget {}
classFooextendsEventTarget {
staticfunctionbar() {}
}
I cannot come up with a sensible reason for Foo.bar to be in the output. But maybe that's just me and maybe the new behavior is a sensible default. Fine. I still require some way to opt out of it. Pretty please. Thank you ;)
The reason will be displayed to describe this comment to others. Learn more.
I agree that the whole concept seems to be misled. I think adding @:keepSub on the extern class allows more fine grained control for the user, and making entire projects not dce-able sounds not like a good tradeoff
The reason will be displayed to describe this comment to others. Learn more.
I hadn't realized that it was so common to extend extern classes. Anyway, I already agreed to changing it like @RealyUniqueName suggested, so there's really no reason for further discussion.
23f94bf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hughsando: This causes a null object reference error on cppia. Any idea what could be going on?
23f94bf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fixed by 6046a10
23f94bf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meh. This means if you extend something ubiquitous as EventTarget/EventDispatcher/EventEmitter, your whole class becomes non-DCE-able. Can we have a way to opt out of this at least?
23f94bf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be great to auto-keep only fields, which override extern ones.
23f94bf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe that would be a bit better indeed. Feel free to change it.
23f94bf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me clarify my particular issue: this change forcibly disables DCE in a number of cases. Consider this try.haxe snippet:
I cannot come up with a sensible reason for
Foo.bar
to be in the output. But maybe that's just me and maybe the new behavior is a sensible default. Fine. I still require some way to opt out of it. Pretty please. Thank you ;)23f94bf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, keeping static fields doesn't make much sense here. And yes, it would be better to only keep overriden extern methods.
23f94bf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that the whole concept seems to be misled. I think adding
@:keepSub
on the extern class allows more fine grained control for the user, and making entire projects not dce-able sounds not like a good tradeoff23f94bf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hadn't realized that it was so common to extend extern classes. Anyway, I already agreed to changing it like @RealyUniqueName suggested, so there's really no reason for further discussion.
23f94bf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, with this change, a minimal js output now contains HaxeError stuff.
23f94bf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed in 0b3e126