Browse Source

[js] less untyped more @:pure

Dan Korostelev 8 years ago
parent
commit
3878d35b2e
1 changed files with 14 additions and 14 deletions
  1. 14 14
      std/js/_std/String.hx

+ 14 - 14
std/js/_std/String.hx

@@ -22,23 +22,23 @@
 @:coreApi extern class String {
 @:coreApi extern class String {
 	var length(default,null) : Int;
 	var length(default,null) : Int;
 
 
-	function new(string:String) : Void;
-	function toUpperCase() : String;
-	function toLowerCase() : String;
-	function charAt( index : Int) : String;
-	function indexOf( str : String, ?startIndex : Int ) : Int;
-	function lastIndexOf( str : String, ?startIndex : Int ) : Int;
-	function split( delimiter : String ) : Array<String>;
-	function toString() : String;
-	function substring( startIndex : Int, ?endIndex : Int ) : String;
+	@:pure function new(string:String) : Void;
+	@:pure function toUpperCase() : String;
+	@:pure function toLowerCase() : String;
+	@:pure function charAt( index : Int) : String;
+	@:pure function indexOf( str : String, ?startIndex : Int ) : Int;
+	@:pure function lastIndexOf( str : String, ?startIndex : Int ) : Int;
+	@:pure function split( delimiter : String ) : Array<String>;
+	@:pure function toString() : String;
+	@:pure function substring( startIndex : Int, ?endIndex : Int ) : String;
 
 
-	inline function charCodeAt( index : Int) : Null<Int> {
-		return untyped HxOverrides.cca(this, index);
+	@:pure inline function charCodeAt( index : Int) : Null<Int> {
+		return @:privateAccess HxOverrides.cca(this, index);
 	}
 	}
 
 
-	inline function substr( pos : Int, ?len : Int ) : String {
-		return untyped HxOverrides.substr(this, pos, len);
+	@:pure inline function substr( pos : Int, ?len : Int ) : String {
+		return @:privateAccess HxOverrides.substr(this, pos, len);
 	}
 	}
 
 
-	static function fromCharCode( code : Int ) : String;
+	@:pure static function fromCharCode( code : Int ) : String;
 }
 }