2
0
Nicolas Cannasse 16 жил өмнө
parent
commit
ced6795a8c
2 өөрчлөгдсөн 19 нэмэгдсэн , 0 устгасан
  1. 1 0
      doc/CHANGES.txt
  2. 18 0
      genas3.ml

+ 1 - 0
doc/CHANGES.txt

@@ -17,6 +17,7 @@ TODO :
 	js/flash8 : use &0xFF in haxe.io.Bytes.set
 	flash9 : fixed switch on Null<Int> verify error
 	flash9 : fixes related to UInt type + error when using Int/UInt comparison
+	as3 : improved Vector support, inline flash.Lib.as
 
 2009-03-22: 2.03
 	optimized Type.enumEq : use index instead of tag comparison for neko/flash9/php

+ 18 - 0
genas3.ml

@@ -370,6 +370,24 @@ let rec gen_call ctx e el r =
 		spr ctx "(";
 		gen_value ctx e;
 		spr ctx ")"
+	| TField ({ eexpr = TTypeExpr (TClassDecl { cl_path = (["flash"],"Lib") }) },f), args ->
+		(match f, args with
+		| "vectorOfArray", [e] | "vectorConvert", [e] ->
+			(match follow r with
+			| TInst ({ cl_path = (["flash"],"Vector") },[t]) ->
+				print ctx "Vector.<%s>(" (type_str ctx t e.epos);
+				gen_value ctx e;
+				print ctx ")";
+			| _ -> assert false)
+		| "as", [e1;e2] ->
+			gen_value ctx e1;
+			spr ctx " as ";
+			gen_value ctx e2
+		| _ ->
+			gen_value ctx e;
+			spr ctx "(";
+			concat ctx "," (gen_value ctx) el;
+			spr ctx ")")
 	| _ ->
 		gen_value ctx e;
 		spr ctx "(";