Created
June 8, 2020 08:11
-
-
Save marek-safar/5107675a13a06d2256bf1a4774256950 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static int BindJSObject(int jsId, int mappedType) | |
{ | |
JSObject? obj; | |
lock (_boundObjects) | |
{ | |
if (!_boundObjects.TryGetValue(jsId, out obj)) | |
{ | |
IntPtr jsIntPtr = (IntPtr)jsId; | |
obj = mappedType > 0 ? BindJSType(jsIntPtr, mappedType) : new JSObject(jsIntPtr); | |
_boundObjects.Add (jsId, obj); | |
} | |
} | |
return (int)(IntPtr)obj?.Handle ?? 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment