coderaiser/minify

Error when removing JS comments

jasondyoungberg opened this issue · 5 comments

I know this is kinda weird, but the javascript code
console.log((()=>{/*Hello World!*/}).toString().slice(7,-3)) -> Hello World!
gets converted to
console.log((()=>{}).toString().slice(7,-3));

I would obviously never use this in my code, but it is a weird feature of javascript that doesn't work with this minifier.

What it should be converted to?

It could be converted to a string "Hello World!", or it could just be left as is. But comments inside functions do matter if toString() is ever called on the function.

This is not the thing that can be determined by static analysis.

What is your use case? It doesn’t looks like a production code :)

I’m not using it, it’s just a weird thing I noticed when messing around with js quirks.

Anyways you can tell about it guys from terser.