mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:27:43 +00:00
js: Don't print newline for empty ArrayBuffer
If we don't have any bytes to print in hex representation, just return early instead of printing a newline in preparation for the data that won't follow. :^)
This commit is contained in:
parent
be3f4c86de
commit
9003dd907e
1 changed files with 2 additions and 0 deletions
|
@ -294,6 +294,8 @@ static void print_array_buffer(const JS::Object& object, HashTable<JS::Object*>&
|
||||||
print_type("ArrayBuffer");
|
print_type("ArrayBuffer");
|
||||||
out("\n byteLength: ");
|
out("\n byteLength: ");
|
||||||
print_value(JS::Value((double)byte_length), seen_objects);
|
print_value(JS::Value((double)byte_length), seen_objects);
|
||||||
|
if (!byte_length)
|
||||||
|
return;
|
||||||
outln();
|
outln();
|
||||||
for (size_t i = 0; i < byte_length; ++i) {
|
for (size_t i = 0; i < byte_length; ++i) {
|
||||||
out("{:02x}", buffer[i]);
|
out("{:02x}", buffer[i]);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue