Skip to content

Commit 9c59abe

Browse files
aduh95ruyadorno
authored andcommitted
crypto: fix webcrypto.subtle signature
PR-URL: #41761 Reviewed-By: Mestery <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Filip Skokan <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 9c6b078 commit 9c59abe

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/internal/crypto/webcrypto.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const {
55
JSONParse,
66
JSONStringify,
77
ObjectDefineProperties,
8+
ObjectGetOwnPropertyDescriptor,
89
SafeSet,
910
SymbolToStringTag,
1011
StringPrototypeRepeat,
@@ -687,7 +688,11 @@ async function decrypt(algorithm, key, data) {
687688
class SubtleCrypto {}
688689
const subtle = new SubtleCrypto();
689690

690-
class Crypto {}
691+
class Crypto {
692+
get subtle() {
693+
return subtle;
694+
}
695+
}
691696
const crypto = new Crypto();
692697

693698
ObjectDefineProperties(
@@ -699,9 +704,8 @@ ObjectDefineProperties(
699704
value: 'Crypto',
700705
},
701706
subtle: {
707+
...ObjectGetOwnPropertyDescriptor(Crypto.prototype, 'subtle'),
702708
enumerable: true,
703-
configurable: false,
704-
value: subtle,
705709
},
706710
getRandomValues: {
707711
enumerable: true,

0 commit comments

Comments
 (0)