浏览代码

(fixed issue #1658)

Simon Krajewski 12 年之前
父节点
当前提交
962b65d136
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      genswf9.ml

+ 2 - 2
genswf9.ml

@@ -334,7 +334,7 @@ let property ctx p t =
 		| Statics { cl_path = [], "Math" } ->
 			(match p with
 			| "POSITIVE_INFINITY" | "NEGATIVE_INFINITY" | "NaN" -> ident p, Some KFloat, false
-			| "floor" | "ceil" | "round" -> ident p, Some KInt, false
+			| "floor" | "ceil" | "round" when ctx.for_call -> ident p, Some KInt, false
 			| "ffloor" | "fceil" | "fround" -> ident (String.sub p 1 (String.length p - 1)), None, false
 			| _ -> ident p, None, false)
 		| _ -> ident p, None, false)
@@ -1509,9 +1509,9 @@ and gen_call ctx retval e el r =
 		let old = ctx.for_call in
 		ctx.for_call <- true;
 		gen_expr ctx true e1;
+		let id , _, _ = property ctx (field_name f) e1.etype in
 		ctx.for_call <- old;
 		List.iter (gen_expr ctx true) el;
-		let id , _, _ = property ctx (field_name f) e1.etype in
 		if retval then begin
 			write ctx (HCallProperty (id,List.length el));
 			coerce ctx (classify ctx r);