I'm getting a very bizarre callstack in my Flex project (AS3).
Main Thread (Suspended:
VerifyError: Error #1068: Array and * cannot be reconciled.)
I was able to reproduce it using this block of code. If you debug, you'll never get inside "failure" function.
private var testArray:Array = [{},{},{}]
private function run():void {
this.failure({});
}
private function failure(o:Object):void {
for each(var el:Object in testArray) {
o.ids = (o.ids||[]).concat(getArray());
}
}
private function getArray():Array { return [Math.random()]; }
When I run the program, this callstack is one line, but this conole shows a big mess as if it were a segmentation fault:
> verify monkeyTest/failure()
> stack:
> scope: [global Object$ flash.events::EventDispatcher$
> flash.display::DisplayObject$
> flash.display::InteractiveObject$
> flash.display::DisplayObjectContainer$
> flash.display::Sprite$
> mx.core::FlexSprite$
> mx.core::UIComponent$
> mx.core::Container$
> mx.core::LayoutContainer$
> mx.core::Application$ monkeyTest$]
> locals: monkeyTest Object? * * *
Any suggestions? Cheers.
EDIT:
This code does not produce the error:
private function failure(o:Object):void {
for each(var el:Object in testArray) {
o.ids = o.ids || [];
o.ids = o.ids.concat(getArray());
}
}