Explorar o código

fixes for JS.

Nicolas Cannasse %!s(int64=19) %!d(string=hai) anos
pai
achega
a8742b0c35
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      std/haxe/Serializer.hx

+ 8 - 0
std/haxe/Serializer.hx

@@ -105,8 +105,16 @@ class Serializer {
 	}
 
 	function serializeRef(v) {
+		#if js
+		var vt = untyped __js__("typeof")(v);
+		#end
 		for( i in 0...cache.length ) {
+			#if js
+			var ci = cache[i];
+			if( untyped __js__("typeof")(ci) == vt && ci == v ) {
+			#else true
 			if( cache[i] == v ) {
+			#end
 				buf.add("r");
 				buf.add(i);
 				return true;