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
Invalid output when indexing anonymous table #15
Comments
Good catch! Looks like an |
Awesome, thanks for the quick response and fix! |
@fnuecke Thanks for the helpful bug report with a reduced test case! Perhaps the fix was a bit naive / incomplete. E.g. After giving it some more thought, I think the Update: Ah, that is another oversimplification. Following that logic, e.g. |
Good point. It probably should. Another testcase: |
What's the status of the bug with anonymous function? |
Well I just took a look and decided to fix this. I think this project has probably been abandoned since the fix was so easy. Just change this
https://github.com/mathiasbynens/luamin/blob/master/luamin.js#L331
If you have any future issues you can easily debug them by running luaparse and looking at what the AST looks like
|
@EdanPyx Care to submit a pull request? |
Done #36 |
I'm not sure if there's a special term for this, but I'm talking about this pattern:
({...})[key]
.For example:
luamin.minify("print(({})[1])")
will outputprint({}[1])
which is invalid. It should remain asprint(({})[1])
.Tested with luaparse 0.1.4 and luamin 0.2.7.
The text was updated successfully, but these errors were encountered: