diff options
author | Li Jin <dragon-fly@qq.com> | 2024-12-19 11:26:23 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2024-12-19 11:30:01 +0800 |
commit | f38c4f94c9ba0499d923e59483d6381b97cce926 (patch) | |
tree | 945fd3658a9018dc2558ddf4f2c95d17e3a80091 /spec/inputs/class.yue | |
parent | 8a3d78c4d5bfe2ba39173e91146025278bf0deb2 (diff) | |
download | yuescript-0.26.1.tar.gz yuescript-0.26.1.tar.bz2 yuescript-0.26.1.zip |
Fixed MoonScript issue # 459.v0.26.1
Supported local/const/close hoist in class body.
Diffstat (limited to 'spec/inputs/class.yue')
-rw-r--r-- | spec/inputs/class.yue | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/inputs/class.yue b/spec/inputs/class.yue index 49537c2..3c73ebc 100644 --- a/spec/inputs/class.yue +++ b/spec/inputs/class.yue | |||
@@ -242,4 +242,19 @@ class Foo | |||
242 | :add | 242 | :add |
243 | :<add> | 243 | :<add> |
244 | 244 | ||
245 | do | ||
246 | global xa, xb | ||
247 | class CX | ||
248 | xa = 1 | ||
249 | xb = 1 | ||
250 | new: => | ||
251 | |||
252 | do | ||
253 | class CY | ||
254 | xa = 1 | ||
255 | local xb = 2 | ||
256 | new: => print xa, xb, xc, xd | ||
257 | const xc = 3 | ||
258 | close xd = <close>: => | ||
259 | |||
245 | nil | 260 | nil |