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

Method writeString

string_unicode.go:153–163  ·  view source on GitHub ↗

assumes already started

(s String)

Source from the content-addressed store, hash-verified

151
152// assumes already started
153func (b *unicodeStringBuilder) writeString(s String) {
154 a, u := devirtualizeString(s)
155 if u != nil {
156 b.buf = append(b.buf, u[1:]...)
157 b.unicode = true
158 } else {
159 for i := 0; i < len(a); i++ {
160 b.buf = append(b.buf, uint16(a[i]))
161 }
162 }
163}
164
165func (b *unicodeStringBuilder) String() String {
166 if b.unicode {

Callers 2

_stringPadMethod · 0.95
execMethod · 0.95

Calls 1

devirtualizeStringFunction · 0.85

Tested by

no test coverage detected