瀏覽代碼

setField now sets the scope for this when the value is a lambda function haXe/PHP

Franco Ponticelli 16 年之前
父節點
當前提交
ee1956c130
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      std/Reflect.hx

+ 1 - 0
std/Reflect.hx

@@ -89,6 +89,7 @@ class Reflect {
 			if( __dollar__typeof(o) == __dollar__tobject )
 				__dollar__objset(o,__dollar__hash(field.__s),value);
 		#elseif php
+			untyped __php__("if (is_array($value) && get_class($value[0]) == '_hx_lambda') $value[0]->scope = $o");
 			untyped __php__("$o->$field = $value");
 		#end
 	}