浏览代码

fix : lookup in types and not in generated code

Nicolas Cannasse 17 年之前
父节点
当前提交
04e383c4d9
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      genswf.ml

+ 2 - 2
genswf.ml

@@ -124,7 +124,7 @@ let generate file ver header infile types hres =
 		ctx.as3code <- (match code with
 			| [i] when Array.length i.hls_fields = 0 ->
 				(* if we don't have any class defined, don't include Boot *)
-				[] 
+				[]
 			| _ ->
 				ctx.f9clips <- [{ f9_cid = None; f9_classname = boot }];
 				code
@@ -171,7 +171,7 @@ let generate file ver header infile types hres =
 		List.iter (fun c ->
 			let path = ExtString.String.nsplit c.f9_classname "." in
 			let path = (match List.rev path with [] -> assert false | x :: l -> List.rev l, x) in
-			if c.f9_cid <> None && not (List.exists (fun i -> getclass i = Some path) ctx.as3code) then
+			if c.f9_cid <> None && not (List.exists (fun t -> Type.t_path t = path) types) then
 				ctx.as3code <- build_movieclip ctx path :: ctx.as3code;
 		) ctx.f9clips;
 		let as3code = (match ctx.as3code with [] -> [] | l -> [tag (TActionScript3 (None,As3hlparse.flatten l))]) in