Input:
function test1(foo = true) {}
function test2({ foo = true }: { foo?: boolean }) {}
function test3([foo = true]: [boolean?]) {}
Current Result:
local function test1(self, foo)
if foo == nil then
foo = true
end
end
local function test2(self, ____TS_bindingPattern0)
local foo = ____TS_bindingPattern0.foo or true
end
local function test3(self, ____TS_bindingPattern0)
local foo = ____TS_bindingPattern0[1] or true
end
Expected Result:
local function test1(self, foo)
if foo == nil then
foo = true
end
end
local function test2(self, ____TS_bindingPattern0)
local foo = ____TS_bindingPattern0.foo
if foo == nil then
foo = true
end
end
local function test3(self, ____TS_bindingPattern0)
local foo = ____TS_bindingPattern0[1]
if foo == nil then
foo = true
end
end
Input:
Current Result:
Expected Result: