これもバグ?

by uwi
FlashPlayer10.1だけで起こるっぽい?
FlashPlayer10.0ならセフセフ
♥0 | Line 23 | Modified 2010-01-15 16:30:35 | MIT License
play

ActionScript3 source code

/**
 * Copyright uwi ( http://wonderfl.net/user/uwi )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/eAxW
 */

package {
    import flash.display.Sprite;
    import flash.text.*;
    
    // FlashPlayer10.1だけで起こるっぽい?
    // FlashPlayer10.0ならセフセフ
    public class FlashTest extends Sprite {
        public function FlashTest() {
            var tf : TextField = new TextField();
            addChild(tf);
            tf.width = 200;
            
            var a : Array = [];
            
            var i : int = 2;
            a[-i] = 1;
            tf.appendText("bug? : " + a[-2] + "\t" + a[-i] + "\n");
            
            var j : int = 3;
            a[int(-j)] = 1;
            tf.appendText("cast : " + a[-3] + "\n");
            
            a[-4] = 2010;
            tf.appendText("directly : " + a[-4] + "\n");
            
            for(var key : String in Object(a)){
                tf.appendText("" + key + "\t" + a[key] + "\n");
            }
        }
    }
}