Fixed AS3 - extra newlines on methods which use activation

Fixed #2162 AS3 switch inside foreach
This commit is contained in:
Jindra Petřík
2023-12-21 23:28:23 +01:00
parent 0ff4cd1f6c
commit a4c2680053
11 changed files with 253 additions and 17 deletions

View File

@@ -1,5 +1,5 @@
@echo off
set COMPILERKIND=flex
set SWFNAME=as3_new
c:\flex\bin\mxmlc.exe -debug=true -output bin/%SWFNAME%.%COMPILERKIND%.swf src/Main.as 1> buildlog.%COMPILERKIND%.txt 2>&1
rem -warnings=false
call c:\flex\bin\mxmlc.bat -debug=true -output bin/%SWFNAME%.%COMPILERKIND%.swf src/Main.as 1> buildlog.%COMPILERKIND%.txt 2>&1
rem -warnings=false

View File

@@ -50,6 +50,7 @@ package
TestForEach;
TestForEachObjectArray;
TestForEachObjectAttribute;
TestForEachSwitch;
TestForEachReturn;
TestForEachReturn2;
TestForGoto;

View File

@@ -0,0 +1,39 @@
package tests {
public class TestForEachSwitch {
public function run() : *{
var a:Boolean = true;
var b:Boolean = true;
var c:Boolean = true;
var s:int = 5;
var obj:Object = {};
for each(var name:String in obj) {
if (a) {
switch (s) {
case 1:
trace("1");
if (b) {
trace("1b");
}
case 2:
trace("2");
if (c) {
trace("2c");
}
break;
case 3:
trace("3");
break;
case 4:
trace("4");
break;
default:
break;
}
}
trace("before_continue");
}
}
}
}