aboutsummaryrefslogtreecommitdiff
path: root/spec/inputs
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2022-11-11 17:19:24 +0800
committerLi Jin <dragon-fly@qq.com>2022-11-11 17:19:24 +0800
commit60f8f00a022ac08701792b2897b72d8c99b50f52 (patch)
tree1f888c1c6b7907d22ffa842648b000fff989506f /spec/inputs
parent209fca096b0be5c47553f4c4a94d95de33b23d31 (diff)
downloadyuescript-0.15.13.tar.gz
yuescript-0.15.13.tar.bz2
yuescript-0.15.13.zip
fix default value issue when doing metatable destructuring.v0.15.13
Diffstat (limited to 'spec/inputs')
-rw-r--r--spec/inputs/destructure.yue10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/inputs/destructure.yue b/spec/inputs/destructure.yue
index 403923a..d161fd8 100644
--- a/spec/inputs/destructure.yue
+++ b/spec/inputs/destructure.yue
@@ -214,5 +214,15 @@ do
214 tb = {} 214 tb = {}
215 <[a + b]>: v1, [c!]: v2 = tb 215 <[a + b]>: v1, [c!]: v2 = tb
216 216
217do
218 {a: {:<add> = addFunc}, b: {<[fieldName]>: field = 123}} = tb
219 {<"abc">: meta_field = "def", <[[any string]]>: abc = 123, <'str'>: def = {}} = tb
220
221 switch tb
222 when {a: {:<add> = addFunc}, b: {<[fieldName]>: field = 123}}
223 print add, field
224 switch tb
225 when {c: {<"abc">: meta_field = "def"}, <[[any string]]>: {d: abc = 123}, <'str'>: {e: def = {}}}
226 print meta_field, abc, def
217nil 227nil
218 228