diff options
author | Asher Gomez <ashersaupingomez@gmail.com> | 2024-09-05 16:22:47 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-05 16:22:47 +1000 |
commit | 713ed065e7cd1013e525a8e571cef08a30de87be (patch) | |
tree | 4237cb806c991d258d786d66afe99e291f5ec477 | |
parent | 0450c12df5deee18407b940ffedeb1a16bab35a1 (diff) |
BREAKING(fs): remove `Deno.File` (#25447)
Towards #22079
-rw-r--r-- | cli/tsc/dts/lib.deno.ns.d.ts | 11 | ||||
-rw-r--r-- | ext/fs/30_fs.js | 3 | ||||
-rw-r--r-- | runtime/js/99_main.js | 2 | ||||
-rw-r--r-- | tests/specs/future/runtime_api/main.js | 1 | ||||
-rw-r--r-- | tests/specs/future/runtime_api/main.out | 1 | ||||
-rw-r--r-- | tests/unit/files_test.ts | 3 |
6 files changed, 0 insertions, 21 deletions
diff --git a/cli/tsc/dts/lib.deno.ns.d.ts b/cli/tsc/dts/lib.deno.ns.d.ts index e47a2d942..319b1da45 100644 --- a/cli/tsc/dts/lib.deno.ns.d.ts +++ b/cli/tsc/dts/lib.deno.ns.d.ts @@ -2530,17 +2530,6 @@ declare namespace Deno { [Symbol.dispose](): void; } - /** - * The Deno abstraction for reading and writing files. - * - * @deprecated This will be removed in Deno 2.0. See the - * {@link https://docs.deno.com/runtime/manual/advanced/migrate_deprecations | Deno 1.x to 2.x Migration Guide} - * for migration instructions. - * - * @category File System - */ - export const File: typeof FsFile; - /** Gets the size of the console as columns/rows. * * ```ts diff --git a/ext/fs/30_fs.js b/ext/fs/30_fs.js index 35bf0e712..f979badb9 100644 --- a/ext/fs/30_fs.js +++ b/ext/fs/30_fs.js @@ -786,8 +786,6 @@ function checkOpenOptions(options) { } } -const File = FsFile; - function readFileSync(path) { return op_fs_read_file_sync(pathFromURL(path)); } @@ -950,7 +948,6 @@ export { cwd, fdatasync, fdatasyncSync, - File, FsFile, fsync, fsyncSync, diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js index d0171acd2..913761f6a 100644 --- a/runtime/js/99_main.js +++ b/runtime/js/99_main.js @@ -801,7 +801,6 @@ function bootstrapMainRuntime(runtimeOptions, warmup = false) { if (internals.future) { delete globalThis.window; delete Deno.Buffer; - delete Deno.File; delete Deno.FsFile.prototype.rid; delete Deno.funlock; delete Deno.funlockSync; @@ -965,7 +964,6 @@ function bootstrapWorkerRuntime( if (internals.future) { delete Deno.Buffer; - delete Deno.File; delete Deno.FsFile.prototype.rid; delete Deno.funlock; delete Deno.funlockSync; diff --git a/tests/specs/future/runtime_api/main.js b/tests/specs/future/runtime_api/main.js index 26a75373e..afaa4e57b 100644 --- a/tests/specs/future/runtime_api/main.js +++ b/tests/specs/future/runtime_api/main.js @@ -1,6 +1,5 @@ console.log("window is", globalThis.window); console.log("Deno.Buffer is", Deno.Buffer); -console.log("Deno.File is", Deno.File); console.log( "Deno.FsFile.prototype.rid is", Deno.openSync(import.meta.filename).rid, diff --git a/tests/specs/future/runtime_api/main.out b/tests/specs/future/runtime_api/main.out index 0aa4e1f7c..d629b13b4 100644 --- a/tests/specs/future/runtime_api/main.out +++ b/tests/specs/future/runtime_api/main.out @@ -1,6 +1,5 @@ window is undefined Deno.Buffer is undefined -Deno.File is undefined Deno.FsFile.prototype.rid is undefined Deno.funlock is undefined Deno.funlockSync is undefined diff --git a/tests/unit/files_test.ts b/tests/unit/files_test.ts index c9c3c0110..7b939d1ec 100644 --- a/tests/unit/files_test.ts +++ b/tests/unit/files_test.ts @@ -1,7 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -// deno-lint-ignore-file no-deprecated-deno-api - import { assert, assertEquals, @@ -24,7 +22,6 @@ Deno.test( async function filesCopyToStdout() { const filename = "tests/testdata/assets/fixture.json"; using file = await Deno.open(filename); - assert(file instanceof Deno.File); assert(file instanceof Deno.FsFile); assert(file.rid > 2); const bytesWritten = await copy(file, Deno.stdout); |