Closed
Bug 472207
Opened 15 years ago
Closed 15 years ago
Vector.splice does not work for non-string vectors.
Categories
(Tamarin Graveyard :: Virtual Machine, defect, P3)
Tracking
(Not tracked)
VERIFIED
INVALID
flash10.1
People
(Reporter: cpeyer, Assigned: tierney)
References
Details
Attachments
(1 file)
1.03 KB,
text/plain
|
Details |
Unexpected results when using vector.splice on int or a user defined class. Run the attached bug file. Actual: HEllo,Bye,cya,Hi 1,0,3 TypeError: Error #1034: Type Coercion failed: cannot convert __AS3__.vec::Vector.<t.as$1::Rectangle>@102c821 to t.as$1.Rectangle. at Vector$object/_spliceHelper() at Vector$object/_splice() at <anonymous>() at t.as$1:tryRectangle()[t.as:54] at global$init()[t.as:61] Expected: HEllo,Bye,cya,Hi 1,5,6,3 [object Rectangle],[object Rectangle],[object Rectangle],[object Rectangle]
Flags: in-testsuite-
Flags: flashplayer-triage+
Flags: flashplayer-qrb?
Reporter | ||
Comment 1•15 years ago
|
||
Reporter | ||
Updated•15 years ago
|
Attachment #355469 -
Attachment mime type: application/x-download → text/plain
Reporter | ||
Updated•15 years ago
|
Flags: in-testsuite- → in-testsuite?
Reporter | ||
Comment 2•15 years ago
|
||
Here's an excerpt of the int sample: var vs:Vector.<int> = new Vector.<int>; vs.push(1); vs.push(2); vs.push(3); var nvs:Vector.<int> = new Vector.<int>; nvs.push(5); nvs.push(6); vs.splice(1, 1, nvs); trace(vs); actual: 1,0,3 expected 1,5,6,3
Reporter | ||
Updated•15 years ago
|
Component: Tracing Virtual Machine → Virtual Machine
OS: Mac OS X → All
QA Contact: tracing-vm → vm
Updated•15 years ago
|
Assignee: nobody → tierney
Status: NEW → ASSIGNED
Flags: flashplayer-qrb? → flashplayer-qrb+
Priority: -- → P3
Target Milestone: --- → flash10.x
Updated•15 years ago
|
Blocks: AS3_Builtins, 478870
Assignee | ||
Comment 3•15 years ago
|
||
This is working as expected. Splice takes a rest argument that contains the items to insert into the Vector - it does not do any "expansion" or anything of those items. The int case produces 0, becuase anything can be converted to a number (though the result is almost always NaN, or 0 for int since int doesn't have NaN).
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → INVALID
Reporter | ||
Comment 4•15 years ago
|
||
According to the documentation for vector.splice: ... items — An optional list of one or more comma-separated values, or a Vector, to insert into the Vector at the position specified in the startIndex parameter. This seems to clearly indicate that a Vector is an acceptable parameter.
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
Assignee | ||
Comment 5•15 years ago
|
||
The documentation is wrong - it was copied from Array.splice where this sort of works, but not in the way you expect. I believe there is already a doc bug on this internally.
Status: REOPENED → RESOLVED
Closed: 15 years ago → 15 years ago
Resolution: --- → INVALID
Reporter | ||
Updated•15 years ago
|
Status: RESOLVED → VERIFIED
Reporter | ||
Comment 6•15 years ago
|
||
Test media not required as this is an invalid bug. Also verified that documentation for Argo has been updated (Vector language has been removed): http://river.corp.adobe.com:81/Flash_Argo/standalone/langref/Vector.html#splice%28%29
Flags: in-testsuite?
You need to log in
before you can comment on or make changes to this bug.
Description
•