浏览代码

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

Dan Korostelev 10 年之前
父节点
当前提交
fdaef5926e
共有 1 个文件被更改,包括 7 次插入0 次删除
  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));
+	}
 }