mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
BEAKING(buffer): remove Deno.readAll[Sync]()
(#25386)
Towards #22079 Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
This commit is contained in:
parent
3d36cbd056
commit
7e11dbb3ac
5 changed files with 1 additions and 53 deletions
|
@ -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 };
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 }];
|
||||
|
|
Loading…
Reference in a new issue