Skip to content

Commit

Permalink
crypto: fix webcrypto.subtle signature
Browse files Browse the repository at this point in the history
PR-URL: #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>
  • Loading branch information
aduh95 authored and danielleadams committed Mar 2, 2022
1 parent 56d6bbf commit 5c882dc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/internal/crypto/webcrypto.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const {
JSONParse,
JSONStringify,
ObjectDefineProperties,
ObjectGetOwnPropertyDescriptor,
SafeSet,
SymbolToStringTag,
StringPrototypeRepeat,
Expand Down Expand Up @@ -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(
Expand All @@ -699,9 +704,8 @@ ObjectDefineProperties(
value: 'Crypto',
},
subtle: {
...ObjectGetOwnPropertyDescriptor(Crypto.prototype, 'subtle'),
enumerable: true,
configurable: false,
value: subtle,
},
getRandomValues: {
enumerable: true,
Expand Down

0 comments on commit 5c882dc

Please sign in to comment.