1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-14 13:41:12 +00:00

GDScriptNativeClass: Allow getting static function as callable

This commit is contained in:
rune-scape
2024-09-21 21:56:11 -07:00
parent e4e024ab88
commit d3ad99d3d1
3 changed files with 20 additions and 2 deletions

View File

@@ -0,0 +1,8 @@
func get_parse_string(t: Variant):
return t.parse_string
func test():
var a: Callable = JSON.parse_string
var b: Callable = get_parse_string(JSON)
prints(a.call("{\"test\": \"a\"}"), a.is_valid())
prints(b.call("{\"test\": \"b\"}"), b.is_valid())

View File

@@ -0,0 +1,3 @@
GDTEST_OK
{ "test": "a" } false
{ "test": "b" } false