From 49eb887cc6325e14211ec4a241ffc4ac98f0f7a9 Mon Sep 17 00:00:00 2001 From: Kenta Moriuchi Date: Tue, 2 May 2023 19:15:45 +0900 Subject: refactor(core): Use `ObjectHasOwn` instead of `ObjectPrototypeHasOwnProperty` (#18952) ES2022 `Object.hasOwn` can be used in snapshot, so I migrate to use it. --- ext/crypto/00_crypto.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ext/crypto') diff --git a/ext/crypto/00_crypto.js b/ext/crypto/00_crypto.js index 5be2e0c1c..1008f4cf6 100644 --- a/ext/crypto/00_crypto.js +++ b/ext/crypto/00_crypto.js @@ -27,7 +27,7 @@ const { JSONStringify, MathCeil, ObjectAssign, - ObjectPrototypeHasOwnProperty, + ObjectHasOwn, ObjectPrototypeIsPrototypeOf, SafeArrayIterator, SafeWeakMap, @@ -211,7 +211,7 @@ function normalizeAlgorithm(algorithm, op) { // 5. let desiredType = undefined; for (const key in registeredAlgorithms) { - if (!ObjectPrototypeHasOwnProperty(registeredAlgorithms, key)) { + if (!ObjectHasOwn(registeredAlgorithms, key)) { continue; } if ( @@ -246,7 +246,7 @@ function normalizeAlgorithm(algorithm, op) { const dict = simpleAlgorithmDictionaries[desiredType]; // 10. for (const member in dict) { - if (!ObjectPrototypeHasOwnProperty(dict, member)) { + if (!ObjectHasOwn(dict, member)) { continue; } const idlType = dict[member]; -- cgit v1.2.3