瀏覽代碼

fixed inheritance bug.

Nicolas Cannasse 19 年之前
父節點
當前提交
9e4ebd1091
共有 2 個文件被更改,包括 3 次插入2 次删除
  1. 1 1
      genneko.ml
  2. 2 1
      genswf8.ml

+ 1 - 1
genneko.ml

@@ -305,7 +305,7 @@ let gen_class c =
 		clpath,
 		(EObject (PMap.fold (gen_method p) c.cl_fields fstring),p)
 	),p) in
-	(EBlock [eclass; estat; (EBinop ("=",field p clpath "__class__",stpath),p)],p)	
+	(EBlock [eclass; estat; call p (builtin p "objsetproto") [clpath; esuper]; (EBinop ("=",field p clpath "__class__",stpath),p)],p)	
 
 let gen_enum_constr c =
 	let p = pos c.ef_pos in

+ 2 - 1
genswf8.ml

@@ -1060,10 +1060,11 @@ let gen_type_def ctx t =
 			push ctx [VReg 0; VStr "__super__"; VNull];
 			setvar ctx VarObj
 		| Some (csuper,_) ->
-			push ctx [VReg 0];
 			push ctx [VReg 0; VStr "__super__"];
 			gen_path ctx csuper.cl_path csuper.cl_extern;
 			setvar ctx VarObj;
+			push ctx [VReg 0];
+			gen_path ctx csuper.cl_path csuper.cl_extern;
 			write ctx AExtends;
 		);
 		(match c.cl_implements with