浏览代码

fixed issue #1001

Nicolas Cannasse 13 年之前
父节点
当前提交
0a74692bc6
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      std/haxe/macro/ExampleJSGenerator.hx

+ 2 - 0
std/haxe/macro/ExampleJSGenerator.hx

@@ -233,6 +233,8 @@ class ExampleJSGenerator {
 	public function generate() {
 		print("var $_, $hxClasses = $hxClasses || {}, $estr = function() { return js.Boot.__string_rec(this,''); }");
 		newline();
+		print("function $bind(o,m) { var f = function(){ return f.method.apply(f.scope, arguments); }; f.scope = o; f.method = m; return f; };");
+		newline();
 		for( t in api.types )
 			genType(t);
 		for( e in inits ) {