|
@@ -454,7 +454,7 @@ class StringTools {
|
|
This operation is not guaranteed to work if `s` contains the `\0`
|
|
This operation is not guaranteed to work if `s` contains the `\0`
|
|
character.
|
|
character.
|
|
**/
|
|
**/
|
|
- public static #if !eval inline #end function fastCodeAt(s:String, index:Int):Null<Int> {
|
|
|
|
|
|
+ public static #if !eval inline #end function fastCodeAt(s:String, index:Int):Int {
|
|
#if neko
|
|
#if neko
|
|
return untyped __dollar__sget(s.__s, index);
|
|
return untyped __dollar__sget(s.__s, index);
|
|
#elseif cpp
|
|
#elseif cpp
|
|
@@ -464,7 +464,7 @@ class StringTools {
|
|
#elseif java
|
|
#elseif java
|
|
return (index < s.length) ? cast(_charAt(s, index), Int) : -1;
|
|
return (index < s.length) ? cast(_charAt(s, index), Int) : -1;
|
|
#elseif js
|
|
#elseif js
|
|
- return (cast s).charCodeAt(index);
|
|
|
|
|
|
+ return (cast s:js.NativeString).charCodeAt(index);
|
|
#elseif python
|
|
#elseif python
|
|
return if (index >= s.length) -1 else python.internal.UBuiltins.ord(python.Syntax.arrayAccess(s, index));
|
|
return if (index >= s.length) -1 else python.internal.UBuiltins.ord(python.Syntax.arrayAccess(s, index));
|
|
#elseif hl
|
|
#elseif hl
|
|
@@ -491,7 +491,7 @@ class StringTools {
|
|
This operation is not guaranteed to work if `s` contains the `\0`
|
|
This operation is not guaranteed to work if `s` contains the `\0`
|
|
character.
|
|
character.
|
|
**/
|
|
**/
|
|
- public static #if !eval inline #end function unsafeCodeAt(s:String, index:Int):Null<Int> {
|
|
|
|
|
|
+ public static #if !eval inline #end function unsafeCodeAt(s:String, index:Int):Int {
|
|
#if neko
|
|
#if neko
|
|
return untyped __dollar__sget(s.__s, index);
|
|
return untyped __dollar__sget(s.__s, index);
|
|
#elseif cpp
|
|
#elseif cpp
|
|
@@ -501,7 +501,7 @@ class StringTools {
|
|
#elseif java
|
|
#elseif java
|
|
return cast(_charAt(s, index), Int);
|
|
return cast(_charAt(s, index), Int);
|
|
#elseif js
|
|
#elseif js
|
|
- return (cast s).charCodeAt(index);
|
|
|
|
|
|
+ return (cast s:js.NativeString).charCodeAt(index);
|
|
#elseif python
|
|
#elseif python
|
|
return python.internal.UBuiltins.ord(python.Syntax.arrayAccess(s, index));
|
|
return python.internal.UBuiltins.ord(python.Syntax.arrayAccess(s, index));
|
|
#elseif hl
|
|
#elseif hl
|