MCPcopy Index your code
hub / github.com/dop251/goja / WriteString

Method WriteString

string_unicode.go:213–225  ·  view source on GitHub ↗
(s String)

Source from the content-addressed store, hash-verified

211}
212
213func (b *StringBuilder) WriteString(s String) {
214 a, u := devirtualizeString(s)
215 if u != nil {
216 b.switchToUnicode(u.Length())
217 b.unicodeBuilder.writeUnicodeString(u)
218 } else {
219 if b.ascii() {
220 b.asciiBuilder.WriteString(string(a))
221 } else {
222 b.unicodeBuilder.writeASCIIString(string(a))
223 }
224 }
225}
226
227func (b *StringBuilder) WriteUTF8String(s string) {
228 firstUnicodeIdx := 0

Callers 15

funcNameFunction · 0.95
TestValueStringBuilderFunction · 0.95
regexpproto_toStringMethod · 0.95
arrayproto_joinMethod · 0.95
string_rawMethod · 0.95
stringReplaceMethod · 0.95
typedArrayProto_joinMethod · 0.95
functionCtorMethod · 0.95
formatStackMethod · 0.95
MarshalJSONMethod · 0.80
WriteUTF8StringMethod · 0.80

Calls 6

switchToUnicodeMethod · 0.95
asciiMethod · 0.95
devirtualizeStringFunction · 0.85
writeUnicodeStringMethod · 0.80
writeASCIIStringMethod · 0.80
LengthMethod · 0.65

Tested by 3

TestValueStringBuilderFunction · 0.76
ExampleRuntime_ForOfFunction · 0.64
TestImportedStringFunction · 0.64