diff --git a/src/nx/script/VM.hx b/src/nx/script/VM.hx index 69e479b..47f35bb 100644 --- a/src/nx/script/VM.hx +++ b/src/nx/script/VM.hx @@ -1913,6 +1913,17 @@ class VM { case VNativeObject(_): NxProxy.wrapInstanceValue(value, this); // bind callbacks on native-backed script instances default: null; } + case VDict(map): + var obj:Dynamic = {}; + for (k in map.keys()) + Reflection.setField(obj, k, valueToHaxe(map.get(k))); + obj; + case VFunction(funcChunk, closure): + // Haxe will call this with whatever args the native passes + Reflect.makeVarArgs((args:Array) -> { + var scriptArgs = [for (a in args) haxeToValue(a)]; + return valueToHaxe(callFunction(funcChunk, closure, scriptArgs)); + }); default: null; } }