Repository: denoland/deno
Pull request: BREAKING(buffer): remove `Deno.readAll[Sync]()`

Towards #22079

Changed files:
filename: runtime/js/13_buffer.js
patch: @@ -234,26 +234,4 @@ class Buffer {
   }
 }
 
-async function readAll(r) {
-  internals.warnOnDeprecatedApi(
-    "Deno.readAll()",
-    new Error().stack,
-    "Use `readAll()` from `https://jsr.io/@std/io/doc/read-all/~` instead.",
-  );
-  const buf = new Buffer();
-  await buf.readFrom(r);
-  return buf.bytes();
-}
-
-function readAllSync(r) {
-  internals.warnOnDeprecatedApi(
-    "Deno.readAllSync()",
-    new Error().stack,
-    "Use `readAllSync()` from `https://jsr.io/@std/io/doc/read-all/~` instead.",
-  );
-  const buf = new Buffer();
-  buf.readFromSync(r);
-  return buf.bytes();
-}
-
-export { Buffer, readAll, readAllSync };
+export { Buffer };

filename: runtime/js/99_main.js
patch: @@ -805,8 +805,6 @@ function bootstrapMainRuntime(runtimeOptions, warmup = false) {
       delete Deno.FsFile.prototype.rid;
       delete Deno.funlock;
       delete Deno.funlockSync;
-      delete Deno.readAll;
-      delete Deno.readAllSync;
       delete Deno.read;
       delete Deno.readSync;
       delete Deno.seek;
@@ -976,8 +974,6 @@ function bootstrapWorkerRuntime(
       delete Deno.FsFile.prototype.rid;
       delete Deno.funlock;
       delete Deno.funlockSync;
-      delete Deno.readAll;
-      delete Deno.readAllSync;
       delete Deno.read;
       delete Deno.readSync;
       delete Deno.seek;

filename: tests/specs/future/runtime_api/main.js
patch: @@ -7,8 +7,6 @@ console.log(
 );
 console.log("Deno.funlock is", Deno.funlock);
 console.log("Deno.funlockSync is", Deno.funlockSync);
-console.log("Deno.readAll is", Deno.readAll);
-console.log("Deno.readAllSync is", Deno.readAllSync);
 console.log("Deno.read is", Deno.read);
 console.log("Deno.readSync is", Deno.readSync);
 console.log("Deno.seek is", Deno.seek);

filename: tests/specs/future/runtime_api/main.out
patch: @@ -4,8 +4,6 @@ Deno.File is undefined
 Deno.FsFile.prototype.rid is undefined
 Deno.funlock is undefined
 Deno.funlockSync is undefined
-Deno.readAll is undefined
-Deno.readAllSync is undefined
 Deno.read is undefined
 Deno.readSync is undefined
 Deno.seek is undefined

filename: tests/unit/buffer_test.ts
patch: @@ -354,28 +354,6 @@ Deno.test({ ignore: DENO_FUTURE }, async function bufferTestGrow() {
   }
 });
 
-Deno.test({ ignore: DENO_FUTURE }, async function testReadAll() {
-  init();
-  assert(testBytes);
-  const reader = new Deno.Buffer(testBytes.buffer as ArrayBuffer);
-  const actualBytes = await Deno.readAll(reader);
-  assertEquals(testBytes.byteLength, actualBytes.byteLength);
-  for (let i = 0; i < testBytes.length; ++i) {
-    assertEquals(testBytes[i], actualBytes[i]);
-  }
-});
-
-Deno.test({ ignore: DENO_FUTURE }, function testReadAllSync() {
-  init();
-  assert(testBytes);
-  const reader = new Deno.Buffer(testBytes.buffer as ArrayBuffer);
-  const actualBytes = Deno.readAllSync(reader);
-  assertEquals(testBytes.byteLength, actualBytes.byteLength);
-  for (let i = 0; i < testBytes.length; ++i) {
-    assertEquals(testBytes[i], actualBytes[i]);
-  }
-});
-
 Deno.test({ ignore: DENO_FUTURE }, function testBufferBytesArrayBufferLength() {
   // defaults to copy
   const args = [{}, { copy: undefined }, undefined, { copy: true }];