diff options
| author | Li Jin <dragon-fly@qq.com> | 2023-12-07 23:49:48 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2023-12-07 23:55:16 +0800 |
| commit | 514b9f97febe8920a78d6078b092fe84b859a963 (patch) | |
| tree | 8c76ba7579f69db7e2c899e4713009b910e0fa89 /spec/inputs/try_catch.yue | |
| parent | a1d719e3bbfe8cd39c05d2a8f49143b9e814f876 (diff) | |
| download | yuescript-514b9f97febe8920a78d6078b092fe84b859a963.tar.gz yuescript-514b9f97febe8920a78d6078b092fe84b859a963.tar.bz2 yuescript-514b9f97febe8920a78d6078b092fe84b859a963.zip | |
changed the if-assignment syntax to prevent some errors.v0.21.0
Diffstat (limited to 'spec/inputs/try_catch.yue')
| -rw-r--r-- | spec/inputs/try_catch.yue | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/inputs/try_catch.yue b/spec/inputs/try_catch.yue index 96a87fc..ccb3f52 100644 --- a/spec/inputs/try_catch.yue +++ b/spec/inputs/try_catch.yue | |||
| @@ -39,14 +39,14 @@ catch err | |||
| 39 | print "OK" | 39 | print "OK" |
| 40 | 40 | ||
| 41 | do | 41 | do |
| 42 | if success, result = try func "abc", 123 | 42 | if success, result := try func "abc", 123 |
| 43 | print result | 43 | print result |
| 44 | 44 | ||
| 45 | success, result = try func "abc", 123 | 45 | success, result = try func "abc", 123 |
| 46 | catch err | 46 | catch err |
| 47 | print err | 47 | print err |
| 48 | 48 | ||
| 49 | print result if success, result = try func "abc", 123 | 49 | print result if success, result := try func "abc", 123 |
| 50 | catch err | 50 | catch err |
| 51 | print err | 51 | print err |
| 52 | 52 | ||
