Note the last two trace() statements, they’re moved outside of the else blocks! This is because of the comments at the end of the two else statements (which are now inside the else blocks). So watch where you put your comments! You can try this by auto-formatting mx.events.EventDispatcher.as and see the same (make sure you don’t save it!)

By the way, I always put my curly braces like this, so I haven’t ran into this bug before, until I tried to auto-format EventDispatcher.as:

1

2

3

4

5

6

7

functiontest(){

if(true){

// comments here

}else{

// and here

}

}

The lesson of the day is: Don’t put your comments at the end of a statement and use auto-format, or you’ll run into logic changes like this!