mirror of
https://github.com/oven-sh/bun
synced 2026-02-12 20:09:04 +00:00
node: test-buffer-write.js (#17450)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user