From f7150a004e26f446fbf7a47bae368f209248fa67 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Tue, 26 Jul 2022 11:34:34 +0800 Subject: make destructuring work on function multiple returned values, fix `a, b[] = 1` crashing issue, no longer support implicit declaring variable to be nil. --- spec/inputs/destructure.yue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'spec/inputs/destructure.yue') diff --git a/spec/inputs/destructure.yue b/spec/inputs/destructure.yue index 24282c0..53f9ea3 100644 --- a/spec/inputs/destructure.yue +++ b/spec/inputs/destructure.yue @@ -12,7 +12,7 @@ do {:a,:b,:c,:d} = yeah {a}, b = one, two - {b}, c = one + {b}, c = one, nil {d}, e = one, two x, {y} = one, two @@ -22,7 +22,7 @@ do {a, :b, c, :d, e, :f, g} = tbl - do :a, :b, c = tbl + do :a, :b, c = tbl, nil do a, :b, :c = tbl, _ @@ -187,3 +187,7 @@ do do const :width, :height = View.size const {:x = 0.0, :y = 0.0} = point + +do + x1, x2, x3, a[], d, {b}, e, c.# = 1, 2, 3, f! + y1, :y2, :y3, y4 = f1!, f2! -- cgit v1.2.3-55-g6feb