jsgen: fix string.runes method (fix #20500) (#24609)

This commit is contained in:
Gonzalo Chumillas 2025-05-30 04:15:08 +01:00 committed by GitHub
parent 90fdf102fc
commit 55eccf6abe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 70 additions and 7 deletions

View file

@ -7,13 +7,10 @@ pub:
}
pub fn (s string) runes() []rune {
mut runes := []rune{}
for i := 0; i < s.len; i++ {
mut r := rune(`0`)
#r = new rune(s.str[i.val].charCodeAt())
runes << r
}
return runes
ret := JS.makeEmptyArray()
#for (r of s.str) array_push(ret,new rune(r),false);
return ret
}
pub fn (s string) slice(a int, b int) string {