Input:
let i = 0;
const sideEffect = () => i++;
enum Foo {
X = sideEffect(),
Y = X,
}
Current Result:
local i = 0
local sideEffect
sideEffect = function() return (function()
local ____TS_tmp = i
i = ____TS_tmp + 1
return ____TS_tmp
end)() end
Foo = {}
Foo.X = sideEffect(_G)
Foo[sideEffect(_G)] = "X"
Foo.Y = sideEffect(_G)
Foo[sideEffect(_G)] = "Y"
Expected Result:
local i = 0
local sideEffect
sideEffect = function() return (function()
local ____TS_tmp = i
i = ____TS_tmp + 1
return ____TS_tmp
end)() end
Foo = {}
Foo.X = sideEffect(_G)
Foo[Foo.X] = "X"
Foo.Y = Foo.X
Foo[Foo.Y] = "Y"
Input:
Current Result:
Expected Result: