浏览代码

use findprop instead of findpropstrict for 'this' access (allow dynamic)

Nicolas Cannasse 17 年之前
父节点
当前提交
60e7fc00ea
共有 2 个文件被更改,包括 3 次插入2 次删除
  1. 1 0
      doc/CHANGES.txt
  2. 2 2
      genswf9.ml

+ 1 - 0
doc/CHANGES.txt

@@ -15,6 +15,7 @@ TODO inlining : substitute class+function type parameters in order to have fully
 	fixes in genAs3
 	fixes in genAs3
 	fix for flash9 : always coerce call return type
 	fix for flash9 : always coerce call return type
 	set all private+protected names from SWF lib to public (allow override+reflect)
 	set all private+protected names from SWF lib to public (allow override+reflect)
+	flash9 : use findprop instead of findpropstrict for 'this' access (allow dynamic)
 
 
 2008-07-17: 2.0-RC1
 2008-07-17: 2.0-RC1
 	genneko : remove big array error (fixed in neko 1.7.1)
 	genneko : remove big array error (fixed in neko 1.7.1)

+ 2 - 2
genswf9.ml

@@ -700,7 +700,7 @@ let gen_access ctx e (forset : 'a) : 'a access =
 		let id, k, closure = property f e1.etype in
 		let id, k, closure = property f e1.etype in
 		if closure && not ctx.for_call then error "In Flash9, this method cannot be accessed this way : please define a local function" e1.epos;
 		if closure && not ctx.for_call then error "In Flash9, this method cannot be accessed this way : please define a local function" e1.epos;
 		(match e1.eexpr with
 		(match e1.eexpr with
-		| TConst TThis when not ctx.in_static -> write ctx (HFindPropStrict id)
+		| TConst TThis when not ctx.in_static -> write ctx (HFindProp id)
 		| _ -> gen_expr ctx true e1);
 		| _ -> gen_expr ctx true e1);
 		(match k with
 		(match k with
 		| Some t -> VCast (id,t)
 		| Some t -> VCast (id,t)
@@ -1177,7 +1177,7 @@ and gen_call ctx retval e el r =
 		coerce ctx (classify ctx r);
 		coerce ctx (classify ctx r);
 	| TField ({ eexpr = TConst TThis },f) , _ when not ctx.in_static ->
 	| TField ({ eexpr = TConst TThis },f) , _ when not ctx.in_static ->
 		let id = ident f in
 		let id = ident f in
-		write ctx (HFindPropStrict id);
+		write ctx (HFindProp id);
 		List.iter (gen_expr ctx true) el;
 		List.iter (gen_expr ctx true) el;
 		if retval then begin
 		if retval then begin
 			write ctx (HCallProperty (id,List.length el));
 			write ctx (HCallProperty (id,List.length el));