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
I added minification of integers inside computed property strings. Doing other non-integer numbers seems risky because esbuild is implemented in Go and Go's number-to-string algorithm could hypothetically be slightly different than JavaScript's in subtle ways, which could potentially cause a miscompilation. I declined to do the () to ! transformation because it's typically a very, very small win and doing it correctly adds code complexity.
input case:
var arguments=[];(function(){console.log(arguments["1"])})("bar",42);
esbuild output:
var arguments=[];(function(){console.log(arguments["1"])})("bar",42);
terser output:
var arguments=[];!function(){console.log(arguments[1])}("bar",42);
By diff this cases, we could find terser could minify the index, and use
!
instead of()
to save more bytes. I find the index minify source code is here: https://github.com/terser/terser/blob/master/lib/compress/index.js#L4128I hope esbuild could support this like terser to make the minification better.
The text was updated successfully, but these errors were encountered: