Closed Bug 454672 Opened 17 years ago Closed 17 years ago

tamarin-central should have describeType available in the avm shell

Categories

(Tamarin Graveyard :: Virtual Machine, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: dschaffe, Assigned: stejohns)

Details

Attachments

(3 files)

The tamarin-tracing core directory contains DescribeType.as, defining the describeType global function in the avmplus.introspection package. The tamarin-central project should have describeType built into the shell also.
Flags: wanted-flashplayer10+
Flags: flashplayer-triage+
The Proxy class should probably also be moved into the core VM, as it was in TT.
Assignee: nobody → stejohns
Attached patch PatchSplinter Review
implement describeType() (and a few related calls) for TC/TR. This is basically a port of the version implemented for TT, with a few bug fixes and tweaks -- the native API produces the type info as a JSON object, and AS3 code transforms it into XML. avmplus.describeType() is essentially a superset of flash.utils.describeType() -- it produces the same results, but with some options to allow skipping the generation of info that isn't necessary for a given call. (Exception: it doesn't provide the "alias" attribute as that is a Flash-specific concept that is unlikely to be moved to the VM anytime soon) Also found & fixed a few bugs related to TraitsMetadata caching (we hadn't been exercising every possible use, as it turns out)... some results were wrong, and a few could result in crashes.
Attachment #346338 - Flags: review?(tierney)
Comment on attachment 346338 [details] [diff] [review] Patch Looks good. I've heard some requests to be able to only ask for certain data from describeType, so that should prove useful in the future.
Attachment #346338 - Flags: review?(tierney) → review+
pushed to redux as changeset: 1053:55b332e70e12
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Subtle (possible) bug: the attributes in the XML are now being output in an order slightly different from the order Flash used, so toXMLString() returns a different string value. In theory, well-written apps shouldn't rely on this, but some of Flash's acceptance tests do, so we may need to tweak this to output entries in the order they used to be in... thoughts?
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
One thing is that user code relies on the field order; we can't prevent that. But either we support a well-documented field order and then implement that, or we write test cases that don't depend on field order.
Ironically, the acceptance test that I added for this does not depend on field order (it takes pain to sort into canonical results)... it's just the internal Flash acceptance tests that are lazy :-) That said, if Flash did so internally, the odds are high that someone out on the web is relying on the current order as well, so I will revisit this in an attempt to get the order the same.
Attached file Patch #2
Tweaks to DescribeType to add attributes and children in an order closer to that of Flash9/10. (There can still be differences in the order that slots are output, but that is impractical to work around and is probably less critical.)
Attachment #351036 - Flags: review?(tierney)
Note: even after the above patch, output may not match Flash9/10 exactly, as the old Flash implementation added slots (eg accessors, variables) in an arbitrary-but-consistent order (based on the order items were added to a hashtable); trying to replicate this precisely would require replicating a bunch of code for no other purpose. I suspect that real-world code is less likely to be sensitive to that ordering, so at this point I'm inclined to leave it as-is... call toXMLString() on describeType() results and considering the string as a whole strikes me as a usecase that isn't typical.
Attachment #351036 - Flags: review?(tierney) → review+
pushed to redux as changeset: 1184:46aa0de4ffcb
Status: REOPENED → RESOLVED
Closed: 17 years ago17 years ago
Resolution: --- → FIXED
Found another subtle incompatibility with FP9/FP10, reopening
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attached patch Patch #3Splinter Review
Interface methods inherited from a grandparent (or higher up inheritance) were being listed in duplicate form, both public ns and interface ns.
Attachment #358462 - Flags: review?(tierney)
Attachment #358462 - Flags: review?(tierney) → review+
pushed to redux as changeset: 1327:8e504b359cf3
Status: REOPENED → RESOLVED
Closed: 17 years ago17 years ago
Resolution: --- → FIXED
testcase: test\acceptance\as3\DescribeType\*
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: