3 ms·
> because it's apparently hard to work out all the ways that the method could be invoked Simple example case of a statement that makes it impossible to minify
by codefined 8y ago
> because it's apparently hard to work out all the ways that the method could be invoked
Simple example case of a statement that makes it impossible to minify function names:
class Test { static func() { /* function code */ } }
test[prompt('function to call')]()
- baddox 8y agoDoesn’t that example also make it impossible to minify the names of anything? Perhaps other than JavaScript modules, since AFAIK the popular module builders like Webpack do compile-time module importing (I believe that even the dynamic import function is recognized at compile time and doesn’t support throwing in a prompt).
- AgentME 8y agoNo, that issue is unique to class/object property names. You can't dynamically reference a variable in a scope by name supplied by a variable in the same way (except by using `eval`, which does in fact cause minifiers and javascript engines to disable a bunch of optimizations in the scope it's used).
- deleted 8y ago[deleted]