diff --git a/lib/internal/crypto/webcrypto.js b/lib/internal/crypto/webcrypto.js index 501ea38fd35104..72499d27ab854a 100644 --- a/lib/internal/crypto/webcrypto.js +++ b/lib/internal/crypto/webcrypto.js @@ -5,6 +5,7 @@ const { JSONParse, JSONStringify, ObjectDefineProperties, + ObjectGetOwnPropertyDescriptor, SafeSet, SymbolToStringTag, StringPrototypeRepeat, @@ -687,7 +688,11 @@ async function decrypt(algorithm, key, data) { class SubtleCrypto {} const subtle = new SubtleCrypto(); -class Crypto {} +class Crypto { + get subtle() { + return subtle; + } +} const crypto = new Crypto(); ObjectDefineProperties( @@ -699,9 +704,8 @@ ObjectDefineProperties( value: 'Crypto', }, subtle: { + ...ObjectGetOwnPropertyDescriptor(Crypto.prototype, 'subtle'), enumerable: true, - configurable: false, - value: subtle, }, getRandomValues: { enumerable: true,