MCPcopy Create free account
hub / github.com/dop251/goja / String

Method String

string_unicode.go:165–177  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

163}
164
165func (b *unicodeStringBuilder) String() String {
166 if b.unicode {
167 return unicodeString(b.buf)
168 }
169 if len(b.buf) < 2 {
170 return stringEmpty
171 }
172 buf := make([]byte, 0, len(b.buf)-1)
173 for _, c := range b.buf[1:] {
174 buf = append(buf, byte(c))
175 }
176 return asciiString(buf)
177}
178
179func (b *unicodeStringBuilder) WriteRune(r rune) {
180 b.Grow(2)

Callers 4

stringFromRuneFunction · 0.95
_stringPadMethod · 0.95
stringproto_repeatMethod · 0.95
execMethod · 0.95

Calls 2

unicodeStringTypeAlias · 0.85
asciiStringTypeAlias · 0.85

Tested by

no test coverage detected