diff options
Diffstat (limited to 'ext/io/12_io.js')
-rw-r--r-- | ext/io/12_io.js | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/ext/io/12_io.js b/ext/io/12_io.js index 9f4a3766b..2a0d589a7 100644 --- a/ext/io/12_io.js +++ b/ext/io/12_io.js @@ -3,8 +3,7 @@ // Interfaces 100% copied from Go. // Documentation liberally lifted from them too. // Thank you! We love Go! <3 - -import { core, primordials } from "ext:core/mod.js"; +import { core, internals, primordials } from "ext:core/mod.js"; const { op_stdin_set_raw, op_is_terminal, @@ -40,6 +39,11 @@ async function copy( dst, options, ) { + internals.warnOnDeprecatedApi( + "Deno.copy()", + new Error().stack, + "Use `copy()` from `https://deno.land/std/io/copy.ts` instead.", + ); let n = 0; const bufSize = options?.bufSize ?? DEFAULT_BUFFER_SIZE; const b = new Uint8Array(bufSize); @@ -65,6 +69,11 @@ async function* iter( r, options, ) { + internals.warnOnDeprecatedApi( + "Deno.iter()", + new Error().stack, + "Use `ReadableStream` instead.", + ); const bufSize = options?.bufSize ?? DEFAULT_BUFFER_SIZE; const b = new Uint8Array(bufSize); while (true) { @@ -81,6 +90,11 @@ function* iterSync( r, options, ) { + internals.warnOnDeprecatedApi( + "Deno.iterSync()", + new Error().stack, + "Use `ReadableStream` instead.", + ); const bufSize = options?.bufSize ?? DEFAULT_BUFFER_SIZE; const b = new Uint8Array(bufSize); while (true) { |