summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/tsc/dts/lib.deno.ns.d.ts10
-rw-r--r--ext/fs/30_fs.js11
2 files changed, 2 insertions, 19 deletions
diff --git a/cli/tsc/dts/lib.deno.ns.d.ts b/cli/tsc/dts/lib.deno.ns.d.ts
index 7b7aa3835..077d00b9e 100644
--- a/cli/tsc/dts/lib.deno.ns.d.ts
+++ b/cli/tsc/dts/lib.deno.ns.d.ts
@@ -2056,16 +2056,6 @@ declare namespace Deno {
* ```
*/
readonly writable: WritableStream<Uint8Array>;
- /**
- * The constructor which takes a resource ID. Generally `FsFile` should
- * not be constructed directly. Instead use {@linkcode Deno.open} or
- * {@linkcode Deno.openSync} to create a new instance of `FsFile`.
- *
- * @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.
- */
- constructor(rid: number);
/** Write the contents of the array buffer (`p`) to the file.
*
* Resolves to the number of bytes written.
diff --git a/ext/fs/30_fs.js b/ext/fs/30_fs.js
index adeceed53..28d8365f0 100644
--- a/ext/fs/30_fs.js
+++ b/ext/fs/30_fs.js
@@ -590,16 +590,9 @@ class FsFile {
});
this.#rid = rid;
if (!symbol || symbol !== SymbolFor("Deno.internal.FsFile")) {
- internals.warnOnDeprecatedApi(
- "new Deno.FsFile()",
- new Error().stack,
- "Use `Deno.open` or `Deno.openSync` instead.",
+ throw new TypeError(
+ "`Deno.FsFile` cannot be constructed, use `Deno.open()` or `Deno.openSync()` instead.",
);
- if (internals.future) {
- throw new TypeError(
- "`Deno.FsFile` cannot be constructed, use `Deno.open()` or `Deno.openSync()` instead.",
- );
- }
}
}