mathiasbynens/mothereff.in

Touching global variables and table indexing

MarisKori opened this issue · 1 comments

lua-minifier

It will be great if you add support of manual global variables and table indexing.
I mean additional optional list of names/indexes by user which will be replaced with a,b,c,d etc.

For example:
Code: arr={p=1,q=2} function f() x = arr.p end
List: p, q
Result: arr={a=1,b=2} function f() x = arr.a end

Example 2:
Code is the same.
List: arr, f, x
Result: a={p=1,q=2} function b() c = arr.p end

It is very useful when using deep structure of tables inside a script, i.e. you don't access those tables outside the script.

Could you please file this against the luamin repository? https://github.com/mathiasbynens/luamin