workaround php issue

see https://github.com/HaxeFoundation/haxe/issues/4915
This commit is contained in:
Andy Li
2016-03-09 15:48:57 +08:00
parent 98184bf9bf
commit 40f66f2232
+11 -2
View File
@@ -528,7 +528,16 @@ class Interp {
function get( o : Dynamic, f : String ) : Dynamic {
if( o == null ) error(EInvalidAccess(f));
return Reflect.getProperty(o,f);
#if php
// https://github.com/HaxeFoundation/haxe/issues/4915
return try {
Reflect.getProperty(o, f);
} catch (e:Dynamic) {
Reflect.field(o, f);
}
#else
return Reflect.getProperty(o, f);
#end
}
function set( o : Dynamic, f : String, v : Dynamic ) : Dynamic {
@@ -538,7 +547,7 @@ class Interp {
}
function fcall( o : Dynamic, f : String, args : Array<Dynamic> ) : Dynamic {
return call(o, Reflect.getProperty(o, f), args);
return call(o, get(o, f), args);
}
function call( o : Dynamic, f : Dynamic, args : Array<Dynamic> ) : Dynamic {