Fixed #2418 AS3 - initialization of class static vars in script initializer (Haxe)

This commit is contained in:
Jindra Petřík
2025-04-13 00:08:10 +02:00
parent c45eb35120
commit 58bd04698e
21 changed files with 197 additions and 87 deletions

View File

@@ -0,0 +1,3 @@
@echo off
c:\HaxeToolkit\haxe\haxe.exe build.hxml
pause

View File

@@ -0,0 +1,4 @@
-cp src
-main Main
-swf output.swf
-swf-version 11

Binary file not shown.

View File

@@ -0,0 +1,9 @@
import flash.display.Sprite;
import flash.Lib;
import tests_classes.TestStaticVars;
class Main extends Sprite {
public static function main() {
var obj = new TestStaticVars(10, 20);
}
}

View File

@@ -0,0 +1,14 @@
package tests_classes;
class TestStaticVars {
public var a:Int;
public var b:Int;
public static var sa:Int = 1001;
public static var sb:Int = 1002;
public function new(a:Int, b:Int) {
this.a = a;
this.b = b;
}
}