diff options
author | Li Jin <dragon-fly@qq.com> | 2022-03-14 13:46:17 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2022-03-14 13:46:17 +0800 |
commit | 0055f2fdb169788a7796821d20c7fba2230ea9ae (patch) | |
tree | 24ecbf48a03e2d4690a51d66e087f4585d196754 /spec/outputs | |
parent | 985761356280bf8625a6568dd83822aae83edc8f (diff) | |
download | yuescript-0055f2fdb169788a7796821d20c7fba2230ea9ae.tar.gz yuescript-0055f2fdb169788a7796821d20c7fba2230ea9ae.tar.bz2 yuescript-0055f2fdb169788a7796821d20c7fba2230ea9ae.zip |
fix more cases that global values are not being cached.
Diffstat (limited to 'spec/outputs')
-rw-r--r-- | spec/outputs/cond.lua | 22 | ||||
-rw-r--r-- | spec/outputs/with.lua | 37 |
2 files changed, 55 insertions, 4 deletions
diff --git a/spec/outputs/cond.lua b/spec/outputs/cond.lua index 4dc5aa5..178bf9b 100644 --- a/spec/outputs/cond.lua +++ b/spec/outputs/cond.lua | |||
@@ -313,4 +313,26 @@ do | |||
313 | print(pi) | 313 | print(pi) |
314 | end | 314 | end |
315 | end | 315 | end |
316 | do | ||
317 | do | ||
318 | local _M = { } | ||
319 | if _M then | ||
320 | local Thing = _M.Thing | ||
321 | a, b = _M.a, _M.b | ||
322 | end | ||
323 | end | ||
324 | end | ||
325 | do | ||
326 | do | ||
327 | local _des_0 = { } | ||
328 | if _des_0 then | ||
329 | _M = _des_0 | ||
330 | local Thing = _M.Thing | ||
331 | do | ||
332 | local _obj_0 = _M | ||
333 | a, b = _obj_0.a, _obj_0.b | ||
334 | end | ||
335 | end | ||
336 | end | ||
337 | end | ||
316 | return nil | 338 | return nil |
diff --git a/spec/outputs/with.lua b/spec/outputs/with.lua index e1497c6..f172b01 100644 --- a/spec/outputs/with.lua +++ b/spec/outputs/with.lua | |||
@@ -157,8 +157,37 @@ do | |||
157 | end | 157 | end |
158 | end | 158 | end |
159 | do | 159 | do |
160 | local _with_0 = dad | 160 | do |
161 | _with_0["if"]("yes") | 161 | local _with_0 = dad |
162 | local y = _with_0["end"].of["function"] | 162 | _with_0["if"]("yes") |
163 | return _with_0 | 163 | local y = _with_0["end"].of["function"] |
164 | end | ||
165 | end | ||
166 | do | ||
167 | do | ||
168 | local _with_0 = SolidRect({ | ||
169 | width = w, | ||
170 | height = h, | ||
171 | color = 0x66000000 | ||
172 | }) | ||
173 | mask = _with_0 | ||
174 | if _with_0 ~= nil then | ||
175 | _with_0.touchEnabled = true | ||
176 | _with_0.swallowTouches = true | ||
177 | end | ||
178 | end | ||
179 | end | ||
180 | do | ||
181 | do | ||
182 | local mask = SolidRect({ | ||
183 | width = w, | ||
184 | height = h, | ||
185 | color = 0x66000000 | ||
186 | }) | ||
187 | if mask ~= nil then | ||
188 | mask.touchEnabled = true | ||
189 | mask.swallowTouches = true | ||
190 | end | ||
191 | end | ||
164 | end | 192 | end |
193 | return nil | ||