Browse Source

use __js__('Object') to prevent clashing with an otherwise defined Object class

Nicolas Cannasse 13 years ago
parent
commit
24b7e6b23b
1 changed files with 2 additions and 2 deletions
  1. 2 2
      std/js/_std/Reflect.hx

+ 2 - 2
std/js/_std/Reflect.hx

@@ -26,7 +26,7 @@
 @:core_api class Reflect {
 
 	public static function hasField( o : Dynamic, field : String ) : Bool {
-		return untyped Object.prototype.hasOwnProperty.call(o, field);
+		return untyped __js__('Object').prototype.hasOwnProperty.call(o, field);
 	}
 
 	public inline static function field( o : Dynamic, field : String ) : Dynamic untyped {
@@ -61,7 +61,7 @@
 	public static function fields( o : Dynamic ) : Array<String> {
 		var a = [];
 		if (o != null) untyped {
-			var hasOwnProperty = Object.prototype.hasOwnProperty;
+			var hasOwnProperty = __js__('Object').prototype.hasOwnProperty;
 			__js__("for( var f in o ) {");
 			if( hasOwnProperty.call(o, f) ) a.push(f);
 			__js__("}");