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
Base element's static method with nocollapse shouldn't be collapsed in subclasses. #3771
Comments
That isn't how We have been working to "soften" collapse properties but we don't have a concrete plan as of yet. However, perhaps you can get away with a weaker version of Collapse Properties (module exports only) in your project in the mean time. |
The use case is a set of APIs that are used before an instance of an object is created. E.g. let's say we have a base class defined like this:
And we have classes that extend this super-class:
Finally, we have some scheduler that interrogates the
The Any advice? |
The best advice I can give with the current state of affairs is to explicitly put For reasons related to optimization that are too complex to go into here, closure-compiler wants to treat static methods as if they were stand-alone functions that just happened to be stuck on a class. It tries really hard to rename 'SomeClass.staticMethod' to a global variable named something like 'SomeClass$staticMethod'. This will break your code if you pass class constructors around as objects and invoke static methods off of them instead of always invoking them via the original class name. I'd love to make closure-compiler stop doing this, but if I do several important projects suddenly increase hugely in output size. I am currently working on ways to at least mitigate this problem. |
If there was at all a way to make |
In this scenario:
The
SubClass
'sgetSomething
static method gets collapsed and removed. However, an overriden static method like this should stay since it's kept in the superclass.The text was updated successfully, but these errors were encountered: