website icon indicating copy to clipboard operation
website copied to clipboard

Document the prototype.valueOf() usage to get pointer from class instance in JS.

Open forcepusher opened this issue 4 years ago • 2 comments

As seen in this issue, it's not really apparent that we can use the valueOf() method to convert a class view into a pointer. I can't find any references to it in the manual, neither the info that it's being automatically converted into a pointer when using __retain(), __release() methods and such.

forcepusher avatar Jan 24 '21 16:01 forcepusher

Do you have thoughts on where and how to document the behavior ideally?

dcodeIO avatar Jan 24 '21 16:01 dcodeIO

I think somewhere around this area. It could also cover the usage of the new constructor as seen here. Regarding how exactly to document it - I'm not sure, I've only recently found it myself. But I think we could just document that same test case.

forcepusher avatar Jan 24 '21 17:01 forcepusher