airsdk / Adobe-Runtime-Support

Report, track and discuss issues in Adobe AIR. Monitored by Adobe - and HARMAN - and maintained by the AIR community.
206 stars 11 forks source link

[Docs] `Object::toJSON()` not documented #3553

Closed itlancer closed 3 weeks ago

itlancer commented 3 weeks ago

Problem Description

Object::toJSON() should be documented similar to Object::toString() https://airsdk.dev/reference/actionscript/3.0/Object.html#toString()

Steps to Reproduce

https://airsdk.dev/reference/actionscript/3.0/Object.html

Actual Result: Object::toJSON() not documented.

Expected Result: Object::toJSON() documented.

ajwfrost commented 3 weeks ago

Hi

There's no Object.toJSON() method, at least not that I can see in the source code, and when I try an example with this, it compiles but then throws a runtime exception.

[Fault] exception, information=TypeError: Error #1006: toJSON is not a function.

See https://github.com/adobe/avmplus/blob/master/core/Object.as

It does appear that some classes do implement a toJSON() method, but those are limited (and basic implementations), and are described in the description of the JSON class here: https://airsdk.dev/reference/actionscript/3.0/JSON.html

Can you confirm how you're seeing a generic Object toJSON() method?

thanks

itlancer commented 3 weeks ago

@ajwfrost Sorry. I misunderstood it with JSON related toJSON() methods for objects stringifying. Closed.