Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marek-safar/5107675a13a06d2256bf1a4774256950 to your computer and use it in GitHub Desktop.
Save marek-safar/5107675a13a06d2256bf1a4774256950 to your computer and use it in GitHub Desktop.
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