Bladeren bron

reverse the reversal (closes #6015)

Simon Krajewski 8 jaren geleden
bovenliggende
commit
a9c8d60450
2 gewijzigde bestanden met toevoegingen van 14 en 1 verwijderingen
  1. 1 1
      src/optimization/analyzerTexprTransformer.ml
  2. 13 0
      tests/optimization/src/issues/Issue6015.hx

+ 1 - 1
src/optimization/analyzerTexprTransformer.ml

@@ -243,7 +243,7 @@ let rec func ctx bb tf t p =
 		end;
 		let bb = declare_var_and_assign bb v e e.epos in
 		let e = {e with eexpr = TLocal v} in
-		let e = List.fold_left (fun e f -> f e) e (List.rev fl) in
+		let e = List.fold_left (fun e f -> f e) e fl in
 		bb,e
 	and declare_var_and_assign bb v e p =
 		(* TODO: this section shouldn't be here because it can be handled as part of the normal value processing *)

+ 13 - 0
tests/optimization/src/issues/Issue6015.hx

@@ -0,0 +1,13 @@
+package issues;
+
+class Issue6015 {
+	@:js('
+		var a = null;
+		var tmp = a.a();
+		String.fromCharCode.apply(null,tmp);
+	')
+	static public function main() {
+		var a:Dynamic = null;
+		untyped String.fromCharCode.apply(null, a.a());
+	}
+}