crypto: fix webcrypto.subtle signature

PR-URL: https://github.com/nodejs/node/pull/41761
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Antoine du Hamel
2022-01-31 23:23:15 +01:00
committed by GitHub
parent 15f1a45c5f
commit 7123a00b03

View File

@@ -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,