aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2021-08-17 16:21:39 +0800
committerLi Jin <dragon-fly@qq.com>2021-08-17 16:21:39 +0800
commit792e942f5269655ee03c48400999f3604b84396c (patch)
treecc3d6fe477f08ffed985e297ee789d2213387a44 /spec
parent7295e9efe092fca4ab6eebf6408af93d5f56dd80 (diff)
downloadyuescript-792e942f5269655ee03c48400999f3604b84396c.tar.gz
yuescript-792e942f5269655ee03c48400999f3604b84396c.tar.bz2
yuescript-792e942f5269655ee03c48400999f3604b84396c.zip
fix issue #64.
Diffstat (limited to 'spec')
-rw-r--r--spec/inputs/destructure.yue29
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/inputs/destructure.yue b/spec/inputs/destructure.yue
index 7bf5a88..c46cef5 100644
--- a/spec/inputs/destructure.yue
+++ b/spec/inputs/destructure.yue
@@ -142,3 +142,32 @@ do
142 142
143 {:a},b = a\if(123) + t, 123 143 {:a},b = a\if(123) + t, 123
144 144
145do
146 {:name = "nameless", :job = "jobless"} = person
147
148 request = (url, options = {}) ->
149 {
150 :method = "GET"
151 :headers = {}
152 :parameters = {}
153 :payload = ""
154 :ok
155 :err
156 :final
157 } = options
158 res = makeRequest(url, method, parameters, payload, ok, err, final)
159 return res
160
161 {key1: {key2: value1 = 123}, :key3 = "abc"} = tb
162
163 {#: mt = {__index: {abc: 123}}, #: {:call# = (-> {}), :add#}} = tb
164
165 {x: {#: mtx = {}}, :y, z: zItem, :index# = -> nil} = tb
166
167 {#: {func: a.b(-> 123).c = item?.defVal}} = tb
168
169do
170 {#: mt = {}, sub#: subFunc} = tb.x
171
172do
173 {x: {#: mt = {}, sub#: subFunc}} = tb