From 0055f2fdb169788a7796821d20c7fba2230ea9ae Mon Sep 17 00:00:00 2001 From: Li Jin Date: Mon, 14 Mar 2022 13:46:17 +0800 Subject: fix more cases that global values are not being cached. --- spec/inputs/cond.yue | 11 +++++++++++ spec/inputs/with.yue | 13 +++++++++++++ 2 files changed, 24 insertions(+) (limited to 'spec/inputs') diff --git a/spec/inputs/cond.yue b/spec/inputs/cond.yue index 42b22a7..773ef91 100644 --- a/spec/inputs/cond.yue +++ b/spec/inputs/cond.yue @@ -208,6 +208,17 @@ do if :pi = math print pi +do + if _M = {} + :Thing = _M + :a, :b = _M + +do + global _M + if _M = {} + :Thing = _M + :a, :b = _M + nil diff --git a/spec/inputs/with.yue b/spec/inputs/with.yue index d88e109..fe140ac 100644 --- a/spec/inputs/with.yue +++ b/spec/inputs/with.yue @@ -121,3 +121,16 @@ do with dad .if "yes" y = .end.of.function + +do + global mask + with? mask = SolidRect width: w, height: h, color: 0x66000000 + .touchEnabled = true + .swallowTouches = true + +do + with? mask = SolidRect width: w, height: h, color: 0x66000000 + .touchEnabled = true + .swallowTouches = true + +nil -- cgit v1.2.3-55-g6feb