From 886f330ec8110a3eb72feb14353f353962179d2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 9 Mar 2020 15:18:02 +0100 Subject: reorg: move JS ops implementations to cli/js/ops/, part 2 (#4283) Following JS ops were moved to separate files in cli/js/ops directory: - io - process - worker_host - web_worker - plugins - timers - signal - permissions --- cli/js/permissions.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cli/js/permissions.ts') diff --git a/cli/js/permissions.ts b/cli/js/permissions.ts index d3f3d163a..8fad8b691 100644 --- a/cli/js/permissions.ts +++ b/cli/js/permissions.ts @@ -1,5 +1,5 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import { sendSync } from "./ops/dispatch_json.ts"; +import * as permissionsOps from "./ops/permissions.ts"; /** Permissions as granted by the caller * See: https://w3c.github.io/permissions/#permission-registry @@ -60,7 +60,7 @@ export class Permissions { * } */ async query(desc: PermissionDescriptor): Promise { - const { state } = sendSync("op_query_permission", desc); + const state = permissionsOps.query(desc); return new PermissionStatus(state); } @@ -69,7 +69,7 @@ export class Permissions { * assert(status.state !== "granted") */ async revoke(desc: PermissionDescriptor): Promise { - const { state } = sendSync("op_revoke_permission", desc); + const state = permissionsOps.revoke(desc); return new PermissionStatus(state); } @@ -82,7 +82,7 @@ export class Permissions { * } */ async request(desc: PermissionDescriptor): Promise { - const { state } = sendSync("op_request_permission", desc); + const state = permissionsOps.request(desc); return new PermissionStatus(state); } } -- cgit v1.2.3