From 515a34b4de222e35c7ade1b92614d746e73d4c2e Mon Sep 17 00:00:00 2001 From: Kenta Moriuchi Date: Thu, 11 Jan 2024 07:37:25 +0900 Subject: refactor: use `core.ensureFastOps()` (#21888) --- ext/cache/01_cache.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'ext/cache') diff --git a/ext/cache/01_cache.js b/ext/cache/01_cache.js index d764d0c42..541feb5c1 100644 --- a/ext/cache/01_cache.js +++ b/ext/cache/01_cache.js @@ -1,6 +1,14 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { core, primordials } from "ext:core/mod.js"; -import * as webidl from "ext:deno_webidl/00_webidl.js"; +const { + op_cache_delete, + op_cache_match, + op_cache_put, + op_cache_put_finish, + op_cache_storage_delete, + op_cache_storage_has, + op_cache_storage_open, +} = core.ensureFastOps(); const { ArrayPrototypePush, ObjectPrototypeIsPrototypeOf, @@ -10,6 +18,8 @@ const { SymbolFor, TypeError, } = primordials; + +import * as webidl from "ext:deno_webidl/00_webidl.js"; import { Request, RequestPrototype, @@ -19,15 +29,7 @@ import { toInnerResponse } from "ext:deno_fetch/23_response.js"; import { URLPrototype } from "ext:deno_url/00_url.js"; import { getHeader } from "ext:deno_fetch/20_headers.js"; import { readableStreamForRid } from "ext:deno_web/06_streams.js"; -const { - op_cache_delete, - op_cache_match, - op_cache_put, - op_cache_put_finish, - op_cache_storage_delete, - op_cache_storage_has, - op_cache_storage_open, -} = core.ensureFastOps(); + class CacheStorage { constructor() { webidl.illegalConstructor(); -- cgit v1.2.3