Browse Source

Lua : Fix string upper/lower case methods

Justin Donaldson 10 years ago
parent
commit
aa220aa0c0
2 changed files with 5 additions and 2 deletions
  1. 3 0
      std/lua/StringTools.hx
  2. 2 2
      std/lua/_std/String.hx

+ 3 - 0
std/lua/StringTools.hx

@@ -19,5 +19,8 @@ extern class StringTools {
 
 
 	@:overload(   function     (str : String, pattern : String, match : Void->String,   ?n : Int): String->Void {})
 	@:overload(   function     (str : String, pattern : String, match : Void->String,   ?n : Int): String->Void {})
 	public static function gmatch(str : String, pattern : String, ?n : Int): Void->String;
 	public static function gmatch(str : String, pattern : String, ?n : Int): Void->String;
+
+	public static function upper(str:String) : String;
+	public static function lower(str:String) : String;
 }
 }
 
 

+ 2 - 2
std/lua/_std/String.hx

@@ -46,8 +46,8 @@ class String {
 	}
 	}
 
 
 
 
-	public function toUpperCase() : String return untyped this.upper();
-	public function toLowerCase() : String return untyped this.lower();
+	public function toUpperCase() : String return lua.StringTools.upper(this);
+	public function toLowerCase() : String return lua.StringTools.lower(this);
 	public function indexOf( str : String, ?startIndex : Int ) : Int {
 	public function indexOf( str : String, ?startIndex : Int ) : Int {
 		if (startIndex == null) startIndex = 1;
 		if (startIndex == null) startIndex = 1;
 		else startIndex += 1;
 		else startIndex += 1;