diff options
| author | Ryan Dahl <ry@tinyclouds.org> | 2020-02-25 09:14:27 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-25 09:14:27 -0500 |
| commit | 91b606aaae23bcb790b55adc5fe70a182a37d564 (patch) | |
| tree | 16b56a21ffcb3991569eda984fbd14073bdbd3ae /cli/js/permissions.ts | |
| parent | 805992b14a65a6dbfb857dea6d9b657477de043d (diff) | |
Clean up how we use opIds (#4118)
Diffstat (limited to 'cli/js/permissions.ts')
| -rw-r--r-- | cli/js/permissions.ts | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/cli/js/permissions.ts b/cli/js/permissions.ts index 229f8de8b..d414dd1ef 100644 --- a/cli/js/permissions.ts +++ b/cli/js/permissions.ts @@ -1,5 +1,4 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import * as dispatch from "./dispatch.ts"; import { sendSync } from "./dispatch_json.ts"; /** Permissions as granted by the caller @@ -61,7 +60,7 @@ export class Permissions { * } */ async query(desc: PermissionDescriptor): Promise<PermissionStatus> { - const { state } = sendSync(dispatch.OP_QUERY_PERMISSION, desc); + const { state } = sendSync("op_query_permission", desc); return new PermissionStatus(state); } @@ -70,7 +69,7 @@ export class Permissions { * assert(status.state !== "granted") */ async revoke(desc: PermissionDescriptor): Promise<PermissionStatus> { - const { state } = sendSync(dispatch.OP_REVOKE_PERMISSION, desc); + const { state } = sendSync("op_revoke_permission", desc); return new PermissionStatus(state); } @@ -83,7 +82,7 @@ export class Permissions { * } */ async request(desc: PermissionDescriptor): Promise<PermissionStatus> { - const { state } = sendSync(dispatch.OP_REQUEST_PERMISSION, desc); + const { state } = sendSync("op_request_permission", desc); return new PermissionStatus(state); } } |
