diff options
| author | Li Jin <dragon-fly@qq.com> | 2021-08-17 16:21:39 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2021-08-17 16:21:39 +0800 |
| commit | 792e942f5269655ee03c48400999f3604b84396c (patch) | |
| tree | cc3d6fe477f08ffed985e297ee789d2213387a44 /spec/inputs | |
| parent | 7295e9efe092fca4ab6eebf6408af93d5f56dd80 (diff) | |
| download | yuescript-792e942f5269655ee03c48400999f3604b84396c.tar.gz yuescript-792e942f5269655ee03c48400999f3604b84396c.tar.bz2 yuescript-792e942f5269655ee03c48400999f3604b84396c.zip | |
fix issue #64.
Diffstat (limited to 'spec/inputs')
| -rw-r--r-- | spec/inputs/destructure.yue | 29 |
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 | ||
| 145 | do | ||
| 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 | |||
| 169 | do | ||
| 170 | {#: mt = {}, sub#: subFunc} = tb.x | ||
| 171 | |||
| 172 | do | ||
| 173 | {x: {#: mt = {}, sub#: subFunc}} = tb | ||
