diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2020-05-06 15:51:33 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-06 15:51:33 -0400 |
commit | 221221cc9758225a85ecebb2de206591abf16e68 (patch) | |
tree | e050bc8601d1ab2b6c6a7a44fbeaa0ce40868685 /cli/js | |
parent | 76c77bb32c642283e61c9a6bb4936401fc43eaba (diff) |
BREAKING: execPath should require allow-read (#5109)
Diffstat (limited to 'cli/js')
-rw-r--r-- | cli/js/lib.deno.ns.d.ts | 2 | ||||
-rw-r--r-- | cli/js/tests/os_test.ts | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/cli/js/lib.deno.ns.d.ts b/cli/js/lib.deno.ns.d.ts index a05ff9fd6..83dc362ea 100644 --- a/cli/js/lib.deno.ns.d.ts +++ b/cli/js/lib.deno.ns.d.ts @@ -147,7 +147,7 @@ declare namespace Deno { * * console.log(Deno.execPath()); // e.g. "/home/alice/.local/bin/deno" * - * Requires `allow-env` permission. + * Requires `allow-read` permission. */ export function execPath(): string; diff --git a/cli/js/tests/os_test.ts b/cli/js/tests/os_test.ts index a44b69e7d..e99002534 100644 --- a/cli/js/tests/os_test.ts +++ b/cli/js/tests/os_test.ts @@ -48,7 +48,10 @@ unitTest(function envPermissionDenied2(): void { // case-insensitive. Case normalization needs be done using the collation // that Windows uses, rather than naively using String.toLowerCase(). unitTest( - { ignore: Deno.build.os !== "windows", perms: { env: true, run: true } }, + { + ignore: Deno.build.os !== "windows", + perms: { read: true, env: true, run: true }, + }, async function envCaseInsensitive() { // Utility function that runs a Deno subprocess with the environment // specified in `inputEnv`. The subprocess reads the environment variables @@ -269,11 +272,11 @@ unitTest(function getDirWithoutPermission(): void { ); }); -unitTest({ perms: { env: true } }, function execPath(): void { +unitTest({ perms: { read: true } }, function execPath(): void { assertNotEquals(Deno.execPath(), ""); }); -unitTest({ perms: { env: false } }, function execPathPerm(): void { +unitTest({ perms: { read: false } }, function execPathPerm(): void { let caughtError = false; try { Deno.execPath(); |