Array.as needs complete test of subclassing

NEW
Assigned to

Status

Tamarin
Library
P3
normal
7 years ago
7 years ago

People

(Reporter: pnkfelix, Assigned: Trevor Baker)

Tracking

(Blocks: 2 bugs)

unspecified
Q1 12 - Brannan
Dependency tree / graph
Bug Flags:
flashplayer-qrb +

Details

Attachments

(1 attachment)

In Actionscript, one can introduce subclasses of Arrays, and override the length getter/setter (among other methods).

We should be including tests of such usage of Array in our acceptance test suite.

In particular, Bug 661330, comment 7 points out a bug in an offered patch that is not caught by our current suite (because we don't have any tests of the length setter).

(Bug 420755 did start down this path with a few simple sanity tests, but these are not complete, as shown above.)

A complete test would at least form a trivial subclass of array that overrides every method it can (where each override just forwards the call up to the Array superclass).

(Arguably it would also be good to have a test that explores the behavior when overriding the length getter/setter.  See Bug 535446, Bug 535798)
Created attachment 558873 [details] [diff] [review]
patch A v0: orphan patch.  not complete.  Adopt me!

(posting my patch so far.  its not complete and wants to be adopted by QE.)
(Reporter)

Updated

7 years ago
Blocks: 661330
Note that the sane form of this test will need to either wait until:
  1. Bug 685204 is fixed or,
  2. work around it.
See Also: → bug 685204

Comment 3

7 years ago
Also note that there can be subclasses of ArrayObject and ArrayClass on the C++ side (and that some such subclasses exist).  Don't know if you want to include that in this bug or not but we need some sort of test for it.

Alas the selftest harness is really not good enough at this point to test that - tests run before the AS environment is up - so it may require some evolution of selftest.  Now that I think about it that evolution could be as simple as having some C++ selftests marked %%as3 and then a mechanism for triggering those tests after the AS3 world is up.  Several possibilities come to mind, SMOP.
(Reporter)

Updated

7 years ago
Flags: flashplayer-qrb?

Comment 4

7 years ago
QE:  adopt Felix's prototype and submit.
Assignee: nobody → trbaker
Blocks: 592726
Flags: flashplayer-qrb? → flashplayer-qrb+
Priority: -- → P3
Target Milestone: --- → Q1 12 - Brannan
A thorough test would cover both dynamic and sealed Array subclasses, and test that dynamic-ness/sealed-ness is properly checked (e.g. exceptions thrown when adding new properties to sealed instance).

See Bug 654807
In particular Bug 654807, comment 9 and Bug 654807, comment 10 should give some notion of interesting corner cases to consider.

See also Bug 688191 (resolving this bug properly would ideally introduce the code coverage that bug asks for).
(Reporter)

Updated

7 years ago
Blocks: 700690
You need to log in before you can comment on or make changes to this bug.