Menu:

Sponsor

Discover Master of Alchemy, our first iPad/iPhone and iPod touch game!

Follow Me

 

Forum's topics

Latest Files

Archives

Top Rated

Categories

Photo Gallery


Alessandro Crugnola on January 27, 2010 in actionscript

Vector.splice bug

Ususally people complain about opensource projects because they lack of documentation ( that's true most of the times.. ), but this doens't happen only there...

Today I've spent a lot of time trying to understand why I was so stupid because I wasn't able to concatenate 2 vectors of int using splice.
But for what you can read from the *official* Adobe documentation, which says (about the third parameter for the splice method):

... 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.

Ok, that's why I didn't know why I couldn't manage to make it work! This simple code gives wrong results:

var v1: Vector.<int> = new Vector.<int>();

v1.push(1);

v1.push(2);

v1.push(3);

v1.push(4);


var v2: Vector.<int> = new Vector.<int>();

v2.push(100);

v2.push(200);


v1.splice( 1, 1, v2 );


// Expected result: [1,100,200,3,4]

// Actual result: [1,0,3,4]


It seems that the third parameter is being casted into int and so only '0' has been inserted into the first Vector! 

I tried to look into Adobe jira bugbase and what I've found there is that it was a known bug since long time and it has been also moved to the tamarin bugbase.

The problem is that at the end they simply closed the bug as invalid bug because the documentation was wrong!

Funny


 

Bookmark and Share

 

Tags: bug , splice , tamarin , vector 

 

1 comments
I raised a bug about that one too - it was closed without explanation, so thanks for this post .. http://bugs.adobe.com/jira/browse/ASC-3619


Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)


Type the characters you see in the picture above.





 

TrackBacks

TrackBack URL for this entry: http://www.sephiroth.it/cgi-bin/mt/mt-tb.cgi/279