From 7de25e2ef75a748356c79d0015a5d934dde4c216 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Tue, 19 Dec 2023 23:29:07 +0800 Subject: fix a const list destructuring case. --- spec/inputs/attrib.yue | 3 +++ spec/outputs/5.1/attrib.lua | 10 ++++++++++ spec/outputs/attrib.lua | 10 ++++++++++ 3 files changed, 23 insertions(+) (limited to 'spec') diff --git a/spec/inputs/attrib.yue b/spec/inputs/attrib.yue index fbff75a..36aca99 100644 --- a/spec/inputs/attrib.yue +++ b/spec/inputs/attrib.yue @@ -13,6 +13,9 @@ do do const a, {b, c}, {d} = f! +do + const [a, b] = [2, 3] + do close v = if flag func! diff --git a/spec/outputs/5.1/attrib.lua b/spec/outputs/5.1/attrib.lua index f782b45..70e7e24 100644 --- a/spec/outputs/5.1/attrib.lua +++ b/spec/outputs/5.1/attrib.lua @@ -40,6 +40,16 @@ do d = _obj_2[1] end end +do + local a, b + do + local _obj_0 = { + 2, + 3 + } + a, b = _obj_0[1], _obj_0[2] + end +end do local v = (function() if flag then diff --git a/spec/outputs/attrib.lua b/spec/outputs/attrib.lua index 919b7e0..181555f 100644 --- a/spec/outputs/attrib.lua +++ b/spec/outputs/attrib.lua @@ -29,6 +29,16 @@ do d = _obj_2[1] end end +do + local a, b + do + local _obj_0 = { + 2, + 3 + } + a, b = _obj_0[1], _obj_0[2] + end +end do local v = (function() if flag then -- cgit v1.2.3-55-g6feb