mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
feat: top-level-for-await (#3212)
This commit is contained in:
parent
51dd91a3cc
commit
aec5a646c9
18 changed files with 257 additions and 263 deletions
|
@ -1,10 +1,7 @@
|
|||
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
|
||||
async function cat(filenames: string[]): Promise<void> {
|
||||
for (const filename of filenames) {
|
||||
const file = await Deno.open(filename);
|
||||
await Deno.copy(Deno.stdout, file);
|
||||
file.close();
|
||||
}
|
||||
const filenames = Deno.args.slice(1);
|
||||
for (const filename of filenames) {
|
||||
const file = await Deno.open(filename);
|
||||
await Deno.copy(Deno.stdout, file);
|
||||
file.close();
|
||||
}
|
||||
|
||||
cat(Deno.args.slice(1));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue