Browse Source

fixed Reflect.createInstance on F9.

Nicolas Cannasse 19 years ago
parent
commit
439b38054e
2 changed files with 3 additions and 3 deletions
  1. 2 2
      genswf9.ml
  2. 1 1
      std/Reflect.hx

+ 2 - 2
genswf9.ml

@@ -1055,8 +1055,8 @@ let generate_reflect_construct ctx cid nargs =
 	let jend = jump ctx J3Always in
 	j();
 	for i = 1 to nargs do
-		write ctx (A3Reg 0);
-		write ctx (A3SmallInt i);
+		write ctx (A3Reg 1);
+		write ctx (A3SmallInt (i - 1));
 		getvar ctx VArray;
 	done;
 	jend();

+ 1 - 1
std/Reflect.hx

@@ -52,7 +52,7 @@ class Reflect {
 	**/
 	public static function createInstance( cl : Dynamic, args : Array<Dynamic> ) : Dynamic {
 		#if flash9
-			return cl.__construct__.call(null,[args]);
+			return cl.__construct__.call(null,args);
 		#else flash
 			var o = { __constructor__ : cl, __proto__ : cl.prototype };
 			cl[untyped "apply"](o,args);