Explorar el Código

js: Print `ArrayBuffer.maxByteLength` when present

ForLoveOfCats hace 3 años
padre
commit
a4f9630470
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      Userland/Utilities/js.cpp

+ 4 - 0
Userland/Utilities/js.cpp

@@ -423,6 +423,10 @@ static void print_array_buffer(JS::Object const& object, HashTable<JS::Object*>&
     print_type("ArrayBuffer");
     print_type("ArrayBuffer");
     js_out("\n  byteLength: ");
     js_out("\n  byteLength: ");
     print_value(JS::Value((double)byte_length), seen_objects);
     print_value(JS::Value((double)byte_length), seen_objects);
+    if (array_buffer.is_resizable_array_buffer()) {
+        js_out("\n  maxByteLength: ");
+        print_value(JS::Value((double)array_buffer.max_byte_length()), seen_objects);
+    }
     if (!byte_length)
     if (!byte_length)
         return;
         return;
     js_outln();
     js_outln();