summaryrefslogtreecommitdiff
path: root/runtime/js/40_read_file.js
diff options
context:
space:
mode:
authorBenjamin Gruenbaum <benjamingr@gmail.com>2021-06-22 18:45:26 +0300
committerGitHub <noreply@github.com>2021-06-22 11:45:26 -0400
commit20b0a5125a80c027f21472eec98f29e5e35629fb (patch)
treef6551848efdd0c1ae87144e78da4c127b46f51ed /runtime/js/40_read_file.js
parent9c0b41e24bc5f4ec08c62517f40b74506ac9f0d1 (diff)
feat(core): support AbortSignal in readFile (#10943)
Diffstat (limited to 'runtime/js/40_read_file.js')
-rw-r--r--runtime/js/40_read_file.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/runtime/js/40_read_file.js b/runtime/js/40_read_file.js
index 7eee28d89..75cfd8074 100644
--- a/runtime/js/40_read_file.js
+++ b/runtime/js/40_read_file.js
@@ -4,7 +4,7 @@
((window) => {
const core = window.Deno.core;
const { open, openSync } = window.__bootstrap.files;
- const { readAll, readAllSync } = window.__bootstrap.io;
+ const { readAllInner, readAllSync } = window.__bootstrap.io;
function readFileSync(path) {
const file = openSync(path);
@@ -16,10 +16,10 @@
}
}
- async function readFile(path) {
+ async function readFile(path, options) {
const file = await open(path);
try {
- const contents = await readAll(file);
+ const contents = await readAllInner(file, options);
return contents;
} finally {
file.close();
@@ -36,10 +36,10 @@
}
}
- async function readTextFile(path) {
+ async function readTextFile(path, options) {
const file = await open(path);
try {
- const contents = await readAll(file);
+ const contents = await readAllInner(file, options);
return core.decode(contents);
} finally {
file.close();