Browse Source

add @:coreApi to Array

Simon Krajewski 11 years ago
parent
commit
c33de726b4
2 changed files with 9 additions and 12 deletions
  1. 7 8
      std/python/_std/Array.hx
  2. 2 4
      std/python/internal/StringImpl.hx

+ 7 - 8
std/python/_std/Array.hx

@@ -26,18 +26,19 @@ import python.lib.Types;
 #end
 
 @:native("list")
+@:coreApi
 extern class Array<T> implements ArrayAccess<T> extends ArrayImpl {
 
-	public var length(get,null) : Int;
+	public var length(default,null) : Int;
 
 	private inline function get_length ():Int return ArrayImpl.get_length(this);
-	
+
 
 	public function new() : Void;
 
 
 	public inline function concat( a : Array<T>) : Array<T> {
-		
+
 		return ArrayImpl.concat(this, a);
 	}
 
@@ -82,7 +83,7 @@ extern class Array<T> implements ArrayAccess<T> extends ArrayImpl {
 
 	public inline function remove(x : T) : Bool {
 		return ArrayImpl.remove(this,x);
-		
+
 	}
 
 	public function reverse() : Void;
@@ -112,7 +113,7 @@ extern class Array<T> implements ArrayAccess<T> extends ArrayImpl {
 	}
 
 
-	
+
 	@:keep private inline function __get(idx:Int):T
 	{
 		return ArrayImpl.__get(this, idx);
@@ -133,7 +134,5 @@ extern class Array<T> implements ArrayAccess<T> extends ArrayImpl {
 		return ArrayImpl.__unsafe_set(this, idx,val);
 	}
 
-	@:noCompletion public function __iter__ ():PyIterator<T>;
-
-	
+	@:noCompletion private function __iter__ ():PyIterator<T>;
 }

+ 2 - 4
std/python/internal/StringImpl.hx

@@ -31,8 +31,6 @@ class StringImpl {
 				return i;
 			}
 		}
-
-		
 	}
 
 	public static inline function fromCharCode( code : Int ) : String {
@@ -40,8 +38,8 @@ class StringImpl {
 		return "";
 		#else
 		var c = code;
-		return (untyped (''.join)(Builtin.map(Builtin.chr, [c])):String);
+		return (untyped (''.join)(Builtin.map(Builtin.chr, cast [c])):String); // TODO: check cast
 		#end
 	}
-	
+
 }