Skip to content

Commit 27008ef

Browse files
committed
fix failing test
1 parent b02e556 commit 27008ef

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

lib/internal/bootstrap/web/exposed-window-or-worker.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
const {
1212
ObjectDefineProperty,
13-
ObjectGetOwnPropertyDescriptor,
1413
globalThis,
1514
} = primordials;
1615

@@ -115,10 +114,13 @@ if (internalBinding('config').hasOpenSSL) {
115114
['Crypto', 'CryptoKey', 'SubtleCrypto'],
116115
);
117116
} else {
118-
ObjectDefineProperty(globalThis, 'crypto',
119-
{ __proto__: null, ...ObjectGetOwnPropertyDescriptor({
120-
get crypto() {
121-
throw new ERR_NO_CRYPTO();
122-
},
123-
}, 'crypto') });
117+
ObjectDefineProperty(globalThis, 'crypto', {
118+
__proto__: null,
119+
configurable: true,
120+
enumerable: true,
121+
writable: true,
122+
value: function crypto() { // eslint-disable-line func-name-matching
123+
throw new ERR_NO_CRYPTO();
124+
},
125+
});
124126
}

0 commit comments

Comments
 (0)