Browse Source

moved Vector utils functions

Nicolas Cannasse 14 years ago
parent
commit
857b1f7df7
3 changed files with 11 additions and 17 deletions
  1. 2 0
      doc/CHANGES.txt
  2. 0 12
      std/flash9/Lib.hx
  3. 9 5
      std/flash9/Vector.hx

+ 2 - 0
doc/CHANGES.txt

@@ -25,6 +25,8 @@
 	all : allow macro type patches
 	flash9 : changed --gen-hx-classes implementation
 	flash9 : added @:getter and @:setter
+	all : added @:require
+	flash9 : moved vector utils functions from flash.Lib to flash.Vector
 
 2010-08-14: 2.06
 	neko : change serializer to be able to handle instances of basic classes from other modules

+ 0 - 12
std/flash9/Lib.hx

@@ -77,18 +77,6 @@ class Lib {
 		return untyped __as__(v,c);
 	}
 
-	#if flash10
-
-	public inline static function vectorOfArray<T>( v : Array<T> ) : Vector<T> {
-		return untyped __vector__(v);
-	}
-
-	public inline static function vectorConvert<T,U>( v : Vector<T> ) : Vector<U> {
-		return untyped __vector__(v);
-	}
-
-	#end
-
 }
 
 

+ 9 - 5
std/flash9/Vector.hx

@@ -1,13 +1,9 @@
 package flash;
 
-#if !flash10
-"The vector class is only available for flash10+"
-#end
-
 /**
 	The Vector class is very similar to Array but is only supported by the Flash Player 10+
 **/
-extern class Vector<T> implements ArrayAccess<T> {
+@:require(flash10) extern class Vector<T> implements ArrayAccess<T> {
 
 	var length : UInt;
 	var fixed : Bool;
@@ -27,4 +23,12 @@ extern class Vector<T> implements ArrayAccess<T> {
 	function indexOf( x : T, ?from : Int ) : Int;
 	function lastIndexOf( x : T, ?from : Int ) : Int;
 
+	public inline static function ofArray<T>( v : Array<T> ) : Vector<T> {
+		return untyped __vector__(v);
+	}
+
+	public inline static function convert<T,U>( v : Vector<T> ) : Vector<U> {
+		return untyped __vector__(v);
+	}
+
 }