Allow free() to be used as Callable

This method is registered in a special way so ClassDB doesn't naturally
know about its existence. Here it is hardcoded if any other option fail
to check if it is about the `free()` method and, if so, say it exists
and return a Callable.
This commit is contained in:
George Marques
2024-01-17 11:27:40 -03:00
parent 107f2961cc
commit b4e08eb752
4 changed files with 22 additions and 1 deletions

View File

@ -0,0 +1,10 @@
func test():
var node := Node.new()
var callable: Callable = node.free
callable.call()
print(node)
node = Node.new()
callable = node["free"]
callable.call()
print(node)

View File

@ -0,0 +1,3 @@
GDTEST_OK
<Freed Object>
<Freed Object>