Browse Source

add test for inlining anon functions within inline functions (see #3426)

Dan Korostelev 10 years ago
parent
commit
fdaef5926e
1 changed files with 7 additions and 0 deletions
  1. 7 0
      tests/optimization/src/TestJs.hx

+ 7 - 0
tests/optimization/src/TestJs.hx

@@ -51,4 +51,11 @@ class TestJs {
 			default: false;
 		}) {}
 	}
+
+	@:js("var a = [1,2,3];var _g = 0;while(_g < a.length) {var v = a[_g];++_g;console.log(v + 2);}")
+	static function testInlineFunctionWithAnonymousCallback() {
+		var a = [1,2,3];
+		inline function forEach(f) for (v in a) f(v);
+		forEach(function(x) trace(x + 2));
+	}
 }