Skip to content

Commit

Permalink
fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
dygabo committed Jun 1, 2024
1 parent b02e556 commit 27008ef
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lib/internal/bootstrap/web/exposed-window-or-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

const {
ObjectDefineProperty,
ObjectGetOwnPropertyDescriptor,
globalThis,
} = primordials;

Expand Down Expand Up @@ -115,10 +114,13 @@ if (internalBinding('config').hasOpenSSL) {
['Crypto', 'CryptoKey', 'SubtleCrypto'],
);
} else {
ObjectDefineProperty(globalThis, 'crypto',
{ __proto__: null, ...ObjectGetOwnPropertyDescriptor({
get crypto() {
throw new ERR_NO_CRYPTO();
},
}, 'crypto') });
ObjectDefineProperty(globalThis, 'crypto', {
__proto__: null,
configurable: true,
enumerable: true,
writable: true,
value: function crypto() { // eslint-disable-line func-name-matching
throw new ERR_NO_CRYPTO();
},
});
}

0 comments on commit 27008ef

Please sign in to comment.