Closed Bug 643455 Opened 13 years ago Closed 6 years ago

Consider refining/documenting/supporting describeTypeJSON

Categories

(Tamarin Graveyard :: Virtual Machine, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX
Future

People

(Reporter: stejohns, Unassigned)

References

Details

Attachments

(1 file)

When the implementation of describeType() was moved from Flash into Tamarin, describeTypeJSON() came into being as a helper class for implementation. It wasn't intended for public use, but I inadvertently left it visible to the public, and people have discovered it (see: http://www.tillschneidereit.de/2009/11/22/improved-reflection-support-in-flash-player-10-1/)

As it turns out, there's a desire and need for the improved reflection capabilities in describeTypeJSON(), so we should consider cleaning it up (it's a little rough as-is) and making it an official API for future releases of Flash.
OpenLaszlo is using this API to implement a `subclassof` operator.  The XML-based describeType interface is much too heavy-weight, so we were happy to find that we could ask for just the information we needed with describeTypeJSON.  The only other way we could think of to compute if one class was a subclass of another (including interfaces) was to create a 'test instance' of the class in question, which is also very inefficient.

So +1 from our team to make this a documented/maintained public API.
Would you be willing to offer one or a few test cases that demo how you use it?  ABC would be great, other formats acceptable to if we can get ABC from them.
Use case of "describeTypeJSON()" in OpenLaszlo to support subclassof() operation.
Flags: flashplayer-qrb+
Target Milestone: --- → Future
People are noting the performance difference between the two.  E.g. see this blog post about JSON performance:

http://compiler.kaustic.net/lab/?p=55

"""
  flash.utils.describeType vs avmplus.describeTypeJSON

  The avmplus.describeTypeJSON trick is very important here… it makes the difference between 77 ms and 10 ms!
"""
Seems like we should really consider doing the cleanup/documentation work for Serrano, if schedule still permits.
Not being able to reflect on private and protected methods is a real drag.  In particular: we use the reflection data for a DI framework, but we're currently restricted to using only public setters/functions for injection; this exposes internal parts of the classes that we'd rather be private/protected.  Would you consider adding flags for INCLUDE_PROTECTED and INCLUDE_PRIVATE?

from http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/utils/package.html#describeType%28%29 :
  Note: describeType() only shows public properties and methods, and will not show properties and methods that are private, package internal or in custom namespaces.
(In reply to comment #6)
> Not being able to reflect on private and protected methods is a real drag. 
> In particular: we use the reflection data for a DI framework, but we're
> currently restricted to using only public setters/functions for injection;
> this exposes internal parts of the classes that we'd rather be
> private/protected.  Would you consider adding flags for INCLUDE_PROTECTED
> and INCLUDE_PRIVATE?
> 
> from
> http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/
> utils/package.html#describeType%28%29 :
>   Note: describeType() only shows public properties and methods, and will
> not show properties and methods that are private, package internal or in
> custom namespaces.

That sounds like a different bug to me, or at least a serious bit of scope creep.

This bug, to my mind, is about provide the *same* information that describeType provides, just in a different serialized format.

Your suggestion is to *expand* the potential information available via our reflection API; that probably would require getting more significant review of the implications of such information exposure.
Is this bug under consideration yet?
It's been more than a year already...
Tamarin isn't maintained anymore. WONTFIX remaining bugs.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: