Sfoglia il codice sorgente

setPrototype -> setClass

Nicolas Cannasse 19 anni fa
parent
commit
486125d212
1 ha cambiato i file con 4 aggiunte e 4 eliminazioni
  1. 4 4
      std/Type.hx

+ 4 - 4
std/Type.hx

@@ -197,15 +197,15 @@ class Type {
 	/**
 	/**
 		Change the class prototype of an object
 		Change the class prototype of an object
 	**/
 	**/
-	public static function setPrototype( obj : Dynamic, proto : Dynamic ) {
+	public static function setClass( obj : Dynamic, cl : Class ) untyped {
 		#if flash9
 		#if flash9
 			throw "Not implemented";
 			throw "Not implemented";
 		#else flash
 		#else flash
-			obj.__proto__ = proto;
+			obj.__proto__ = cl.prototype;
 		#else js
 		#else js
-			obj.__proto__ = proto;
+			obj.__proto__ = cl.prototype;
 		#else neko
 		#else neko
-			untyped __dollar__objsetproto(obj,proto);
+			__dollar__objsetproto(obj,cl.prototype);
 		#else error
 		#else error
 		#end
 		#end
 	}
 	}