js: draft support for compiling -b js x_test.v

This commit is contained in:
Delyan Angelov 2021-07-27 13:46:48 +03:00
parent 90b9b9d755
commit b0a721b2ec
No known key found for this signature in database
GPG key ID: 66886C0F12D595ED
4 changed files with 179 additions and 1 deletions

View file

@ -323,6 +323,14 @@ pub fn (s string) to_lower() string {
return result
}
// TODO: check if that behaves the same as V's own string.replace(old_sub,new_sub):
pub fn (s string) replace(old_sub string, new_sub string) string {
mut result := ''
#result = new string( s.str.replaceAll(old_sub.str, new_sub.str) )
return result
}
pub fn (s string) to_upper() string {
mut result := ''
#let str = s.str.toUpperCase()