diff options
author | Kenta Moriuchi <moriken@kimamass.com> | 2023-05-01 22:30:02 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-01 15:30:02 +0200 |
commit | 6728ad4203d731e555dabf89ec6157f113454ce6 (patch) | |
tree | 956dc2d403b5a6ef107c35cab1ccc259ad4d86a1 /ext/crypto/00_crypto.js | |
parent | 94a148cdb6f7660518c75a3c20109bf64848f0f1 (diff) |
fix(core): Use primordials for methods (#18839)
I would like to get this change into Deno before merging
https://github.com/denoland/deno_lint/pull/1152
Diffstat (limited to 'ext/crypto/00_crypto.js')
-rw-r--r-- | ext/crypto/00_crypto.js | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/ext/crypto/00_crypto.js b/ext/crypto/00_crypto.js index 2208124f6..5be2e0c1c 100644 --- a/ext/crypto/00_crypto.js +++ b/ext/crypto/00_crypto.js @@ -12,11 +12,12 @@ const primordials = globalThis.__bootstrap.primordials; import * as webidl from "ext:deno_webidl/00_webidl.js"; import DOMException from "ext:deno_web/01_dom_exception.js"; const { + ArrayBufferIsView, ArrayBufferPrototype, - ArrayBufferPrototypeSlice, ArrayBufferPrototypeGetByteLength, - ArrayBufferIsView, + ArrayBufferPrototypeSlice, ArrayPrototypeEvery, + ArrayPrototypeFilter, ArrayPrototypeFind, ArrayPrototypeIncludes, DataViewPrototypeGetBuffer, @@ -28,21 +29,21 @@ const { ObjectAssign, ObjectPrototypeHasOwnProperty, ObjectPrototypeIsPrototypeOf, - StringPrototypeToLowerCase, - StringPrototypeToUpperCase, - StringPrototypeCharCodeAt, - StringFromCharCode, SafeArrayIterator, SafeWeakMap, + StringFromCharCode, + StringPrototypeCharCodeAt, + StringPrototypeToLowerCase, + StringPrototypeToUpperCase, Symbol, SymbolFor, SyntaxError, - TypedArrayPrototypeSlice, + TypeError, TypedArrayPrototypeGetBuffer, TypedArrayPrototypeGetByteLength, TypedArrayPrototypeGetByteOffset, TypedArrayPrototypeGetSymbolToStringTag, - TypeError, + TypedArrayPrototypeSlice, Uint8Array, WeakMapPrototypeGet, WeakMapPrototypeSet, @@ -388,7 +389,10 @@ function constructKey(type, extractable, usages, algorithm, handle) { * @returns */ function usageIntersection(a, b) { - return a.filter((i) => b.includes(i)); + return ArrayPrototypeFilter( + a, + (i) => ArrayPrototypeIncludes(b, i), + ); } // TODO(lucacasonato): this should be moved to rust |