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 <[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]>
  • Loading branch information
aduh95 authored and danielleadams committed Mar 14, 2022
1 parent 1f65620 commit 33abbf9
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 33abbf9

Please sign in to comment.