virtualx-engine/modules/gdscript/tests/scripts/runtime/features/lambda_use_self.gd

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
328 B
GDScript3
Raw Normal View History

2022-04-20 19:22:22 +02:00
var member = "foo"
func bar():
print("bar")
func test():
var lambda1 = func():
print(member)
lambda1.call()
var lambda2 = func():
var nested = func():
print(member)
nested.call()
lambda2.call()
var lambda3 = func():
bar()
lambda3.call()
var lambda4 = func():
return self
print(lambda4.call() == self)