diff --git a/cli/diagnostics.rs b/cli/diagnostics.rs index 5b2ce36414..0ba1a23ae2 100644 --- a/cli/diagnostics.rs +++ b/cli/diagnostics.rs @@ -56,8 +56,6 @@ const UNSTABLE_DENO_PROPS: &[&str] = &[ "signal", "signals", "startTls", - "symlink", - "symlinkSync", "systemMemoryInfo", "systemCpuInfo", "umask", diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts index aa10ce3afc..cbbf44c849 100644 --- a/cli/dts/lib.deno.ns.d.ts +++ b/cli/dts/lib.deno.ns.d.ts @@ -2273,4 +2273,42 @@ declare namespace Deno { /** The URL of the entrypoint module entered from the command-line. */ export const mainModule: string; + + export type SymlinkOptions = { + type: "file" | "dir"; + }; + + /** + * Creates `newpath` as a symbolic link to `oldpath`. + * + * The options.type parameter can be set to `file` or `dir`. This argument is only + * available on Windows and ignored on other platforms. + * + * ```ts + * Deno.symlinkSync("old/name", "new/name"); + * ``` + * + * Requires `allow-write` permission. */ + export function symlinkSync( + oldpath: string, + newpath: string, + options?: SymlinkOptions, + ): void; + + /** + * Creates `newpath` as a symbolic link to `oldpath`. + * + * The options.type parameter can be set to `file` or `dir`. This argument is only + * available on Windows and ignored on other platforms. + * + * ```ts + * await Deno.symlink("old/name", "new/name"); + * ``` + * + * Requires `allow-write` permission. */ + export function symlink( + oldpath: string, + newpath: string, + options?: SymlinkOptions, + ): Promise; } diff --git a/cli/dts/lib.deno.unstable.d.ts b/cli/dts/lib.deno.unstable.d.ts index 5007d657d5..a71e5036d3 100644 --- a/cli/dts/lib.deno.unstable.d.ts +++ b/cli/dts/lib.deno.unstable.d.ts @@ -36,46 +36,6 @@ declare namespace Deno { rows: number; }; - export type SymlinkOptions = { - type: "file" | "dir"; - }; - - /** **UNSTABLE**: This API needs a security review. - * - * Creates `newpath` as a symbolic link to `oldpath`. - * - * The options.type parameter can be set to `file` or `dir`. This argument is only - * available on Windows and ignored on other platforms. - * - * ```ts - * Deno.symlinkSync("old/name", "new/name"); - * ``` - * - * Requires `allow-write` permission. */ - export function symlinkSync( - oldpath: string, - newpath: string, - options?: SymlinkOptions, - ): void; - - /** **UNSTABLE**: This API needs a security review. - * - * Creates `newpath` as a symbolic link to `oldpath`. - * - * The options.type parameter can be set to `file` or `dir`. This argument is only - * available on Windows and ignored on other platforms. - * - * ```ts - * await Deno.symlink("old/name", "new/name"); - * ``` - * - * Requires `allow-write` permission. */ - export function symlink( - oldpath: string, - newpath: string, - options?: SymlinkOptions, - ): Promise; - /** **Unstable** There are questions around which permission this needs. And * maybe should be renamed (loadAverage?) * diff --git a/runtime/js/90_deno_ns.js b/runtime/js/90_deno_ns.js index bd56538d1c..d820d08964 100644 --- a/runtime/js/90_deno_ns.js +++ b/runtime/js/90_deno_ns.js @@ -88,6 +88,8 @@ fsync: __bootstrap.fs.fsync, fdatasyncSync: __bootstrap.fs.fdatasyncSync, fdatasync: __bootstrap.fs.fdatasync, + symlink: __bootstrap.fs.symlink, + symlinkSync: __bootstrap.fs.symlinkSync, link: __bootstrap.fs.link, linkSync: __bootstrap.fs.linkSync, permissions: __bootstrap.permissions.permissions, @@ -128,8 +130,6 @@ futimeSync: __bootstrap.fs.futimeSync, utime: __bootstrap.fs.utime, utimeSync: __bootstrap.fs.utimeSync, - symlink: __bootstrap.fs.symlink, - symlinkSync: __bootstrap.fs.symlinkSync, HttpClient: __bootstrap.fetch.HttpClient, createHttpClient: __bootstrap.fetch.createHttpClient, }; diff --git a/runtime/ops/fs.rs b/runtime/ops/fs.rs index 5f5425dfa2..8560d9f3e4 100644 --- a/runtime/ops/fs.rs +++ b/runtime/ops/fs.rs @@ -1203,7 +1203,6 @@ fn op_symlink_sync( args: Value, _zero_copy: &mut [ZeroCopyBuf], ) -> Result { - super::check_unstable(state, "Deno.symlink"); let args: SymlinkArgs = serde_json::from_value(args)?; let oldpath = PathBuf::from(&args.oldpath); let newpath = PathBuf::from(&args.newpath); @@ -1254,8 +1253,6 @@ async fn op_symlink_async( args: Value, _zero_copy: BufVec, ) -> Result { - super::check_unstable2(&state, "Deno.symlink"); - let args: SymlinkArgs = serde_json::from_value(args)?; let oldpath = PathBuf::from(&args.oldpath); let newpath = PathBuf::from(&args.newpath);