Parcourir la source

fixed as3 property access on interfaces

Simon Krajewski il y a 13 ans
Parent
commit
21e3f9ab61
4 fichiers modifiés avec 13 ajouts et 6 suppressions
  1. 4 2
      genas3.ml
  2. 2 2
      tests/unit/Test.hx
  3. 6 1
      tests/unit/TestReflect.hx
  4. 1 1
      tests/unit/unit.hxml

+ 4 - 2
genas3.ml

@@ -924,10 +924,12 @@ let generate_field ctx static f =
 				(match f.cf_kind with
 				| Var v ->
 					(match v.v_read with
-					| AccNormal | AccCall _ -> print ctx "function get %s() : %s;" id t;
+					| AccNormal -> print ctx "function get %s() : %s;" id t;
+					| AccCall s -> print ctx "function %s() : %s;" s t;
 					| _ -> ());
 					(match v.v_write with
-					| AccNormal | AccCall _ -> print ctx "function set %s( __v : %s ) : void;" id t;
+					| AccNormal -> print ctx "function set %s( __v : %s ) : void;" id t;
+					| AccCall s -> print ctx "function %s( __v : %s ) : %s;" s t t;
 					| _ -> ());
 				| _ -> assert false)
 			| _ -> ()

+ 2 - 2
tests/unit/Test.hx

@@ -117,7 +117,7 @@ class Test #if swf_mark implements mt.Protect #end #if as3 implements haxe.Publi
 		}
 		haxe.Log.trace(msg,pos);
 		reportCount++;
-		if( reportCount == 20 ) {
+		if( reportCount == 50 ) {
 			trace("Too many errors");
 			report = function(msg,?pos) {};
 		}
@@ -196,9 +196,9 @@ class Test #if swf_mark implements mt.Protect #end #if as3 implements haxe.Publi
 			new TestMisc(),
 			new TestResource(),
 			new TestInt64(),			
-			#if (!as3)
 			new TestReflect(),
 			new TestSerialize(),
+			#if (!as3)
 			new TestMeta(),
 			#end
 			//new TestUnspecified(),

+ 6 - 1
tests/unit/TestReflect.hx

@@ -75,7 +75,12 @@ class TestReflect extends Test {
 	}
 
 	static inline function u2( s : String, s2 ) : String {
-		return u(s)+"."+u(s2);
+		#if as3
+		return s + "." +s2;
+		#else
+		// this causes a null pointer exception on as3 for whatever reason
+		return u(s) + "." + u(s2);
+		#end
 	}
 
 	static var TNAMES = [

+ 1 - 1
tests/unit/unit.hxml

@@ -57,7 +57,7 @@ params.hxml
 params.hxml
 -main unit.Test
 -as3 as3
--cmd mxmlc as3/__main__.as --output unit9_as3.swf
+-cmd mxmlc -debug as3/__main__.as --output unit9_as3.swf
 
 #java
 --next