Browse Source

Fix exists on Safari

Pascal Peridont 19 years ago
parent
commit
bb6a6381d0
1 changed files with 9 additions and 1 deletions
  1. 9 1
      std/Hash.hx

+ 9 - 1
std/Hash.hx

@@ -87,7 +87,15 @@ class Hash<T> {
 		#if flash
 		return untyped h["hasOwnProperty"](key);
 		#else js
-		return untyped this.hasOwnProperty.call(h,key);
+		try {
+			return untyped this.hasOwnProperty.call(h,key);
+		}catch(e:Dynamic){
+			untyped __js__("
+				for(var i in this.h)
+					if( i == key ) return true;
+			");
+			return false;
+		}
 		#else neko
 		return untyped __dollar__hmem(h,key.__s,null);
 		#else error