node: test-buffer-write.js (#17450)

This commit is contained in:
Meghan Denny
2025-02-22 00:24:44 -08:00
committed by GitHub
parent f6c3b92f73
commit d862966631
15 changed files with 290 additions and 139 deletions

View File

@@ -398,7 +398,7 @@ void determineSpecificType(JSC::VM& vm, JSC::JSGlobalObject* globalObject, WTF::
StringView view = str;
const bool needsEllipsis = jsString->length() > 28;
const bool needsEscape = str->contains('\'');
const bool needsEscape = str->contains('"');
if (needsEllipsis) {
view = str->substring(0, 25);
}
@@ -425,17 +425,13 @@ void determineSpecificType(JSC::VM& vm, JSC::JSGlobalObject* globalObject, WTF::
}
}
} else {
builder.append('\'');
builder.append('"');
builder.append(view);
}
if (needsEllipsis) {
builder.append("..."_s);
}
if (UNLIKELY(needsEscape)) {
builder.append('"');
} else {
builder.append('\'');
}
builder.append('"');
builder.append(')');
return;
}