Skip to content
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

Fix vararg operator not being parsed in function arguments. #1

Closed
wants to merge 2 commits into from

Conversation

Anaminus
Copy link

This change modifies the "varlist" function so that it will parse a ... operator that occurs at the end of the variable list. Since varlist is used in multiple contexts, a "funcArgs" argument is added to enforce whether the operator should be parsed.

This change also removes trailing whitespace present in minify.lua.

@n1tehawk
Copy link

n1tehawk commented Aug 14, 2017

Commit 1b5254f addresses only part of the problem:

  • It still fails if the argument list starts with ..., i.e. the function has only varargs.
  • It doesn't prevent the ... "ID" from being localized later, meaning that the vararg symbol gets replaced with an actual identifier. This turns the minified function into a non-vararg one, subsequently causing Lua to choke on any usage of ... within the function body.

I've attempted to correct these issues in #2.

Regards, NiteHawk

@Anaminus
Copy link
Author

I agree. Closing.

@Anaminus Anaminus closed this Aug 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants