Skip to content

Commit 0027d6e

Browse files
committed
js: fix tos
1 parent 3af29dc commit 0027d6e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

vlib/builtin/js/string.js.v

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,10 @@ pub fn (_rune string) utf32_code() int {
10611061
return res
10621062
}
10631063

1064-
pub fn tos(jsstr JS.String) string {
1064+
pub fn tos(jsstr JS.String, len int) string {
1065+
if len == 0 {
1066+
return ''
1067+
}
10651068
res := ''
10661069
#res.str = jsstr
10671070

0 commit comments

Comments
 (0)