diff options
author | Li Jin <dragon-fly@qq.com> | 2023-12-19 23:29:07 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2023-12-19 23:29:07 +0800 |
commit | 7de25e2ef75a748356c79d0015a5d934dde4c216 (patch) | |
tree | 4b6eb791750a93e1ab68066cd503247dba91f80d /spec | |
parent | 8a7b5cc48c22f910a02320b547b76283307a1b83 (diff) | |
download | yuescript-7de25e2ef75a748356c79d0015a5d934dde4c216.tar.gz yuescript-7de25e2ef75a748356c79d0015a5d934dde4c216.tar.bz2 yuescript-7de25e2ef75a748356c79d0015a5d934dde4c216.zip |
fix a const list destructuring case.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/inputs/attrib.yue | 3 | ||||
-rw-r--r-- | spec/outputs/5.1/attrib.lua | 10 | ||||
-rw-r--r-- | spec/outputs/attrib.lua | 10 |
3 files changed, 23 insertions, 0 deletions
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 | |||
@@ -14,6 +14,9 @@ do | |||
14 | const a, {b, c}, {d} = f! | 14 | const a, {b, c}, {d} = f! |
15 | 15 | ||
16 | do | 16 | do |
17 | const [a, b] = [2, 3] | ||
18 | |||
19 | do | ||
17 | close v = if flag | 20 | close v = if flag |
18 | func! | 21 | func! |
19 | else | 22 | else |
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 | |||
@@ -41,6 +41,16 @@ do | |||
41 | end | 41 | end |
42 | end | 42 | end |
43 | do | 43 | do |
44 | local a, b | ||
45 | do | ||
46 | local _obj_0 = { | ||
47 | 2, | ||
48 | 3 | ||
49 | } | ||
50 | a, b = _obj_0[1], _obj_0[2] | ||
51 | end | ||
52 | end | ||
53 | do | ||
44 | local v = (function() | 54 | local v = (function() |
45 | if flag then | 55 | if flag then |
46 | return func() | 56 | return func() |
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 | |||
@@ -30,6 +30,16 @@ do | |||
30 | end | 30 | end |
31 | end | 31 | end |
32 | do | 32 | do |
33 | local a, b | ||
34 | do | ||
35 | local _obj_0 = { | ||
36 | 2, | ||
37 | 3 | ||
38 | } | ||
39 | a, b = _obj_0[1], _obj_0[2] | ||
40 | end | ||
41 | end | ||
42 | do | ||
33 | local v <close> = (function() | 43 | local v <close> = (function() |
34 | if flag then | 44 | if flag then |
35 | return func() | 45 | return func() |