浏览代码

[as3] fix accessing `String.iterator()` and `String.keyValueIterator()` on string literals typed as `Dynamic` (#8120)

Alexander Kuzmenko 6 年之前
父节点
当前提交
cbb0512f04
共有 1 个文件被更改,包括 8 次插入8 次删除
  1. 8 8
      src/generators/genas3.ml

+ 8 - 8
src/generators/genas3.ml

@@ -650,14 +650,6 @@ and gen_expr ctx e =
 	| TEnumParameter (e,_,i) ->
 		gen_value ctx e;
 		print ctx ".params[%i]" i;
-	| TField (e, ((FDynamic "iterator") | (FAnon { cf_name = "iterator" }))) when is_const_string e ->
-		print ctx "new haxe.iterators.StringIterator(";
-		gen_value ctx e;
-		print ctx ")"
-	| TField (e, ((FDynamic "keyValueIterator") | (FAnon { cf_name = "keyValueIterator" }))) when is_const_string e ->
-		print ctx "new haxe.iterators.StringKeyValueIterator(";
-		gen_value ctx e;
-		print ctx ")"
 	| TField (e,s) ->
 		gen_value ctx e;
 		gen_field_access ctx e.etype (field_name s)
@@ -719,6 +711,14 @@ and gen_expr ctx e =
 		gen_expr ctx f.tf_expr;
 		ctx.in_static <- old;
 		h();
+	| TCall ({ eexpr = TField (e, ((FDynamic "iterator") | (FAnon { cf_name = "iterator" }))) }, []) when is_const_string e ->
+		print ctx "new haxe.iterators.StringIterator(";
+		gen_value ctx e;
+		print ctx ")"
+	| TCall ({ eexpr = TField (e, ((FDynamic "keyValueIterator") | (FAnon { cf_name = "keyValueIterator" }))) }, []) when is_const_string e ->
+		print ctx "new haxe.iterators.StringKeyValueIterator(";
+		gen_value ctx e;
+		print ctx ")"
 	| TCall (v,el) ->
 		gen_call ctx v el e.etype
 	| TArrayDecl el ->