crypto: fix globalThis.crypto this check · nodejs/node@f7dba5b · GitHub
Skip to content

Commit f7dba5b

Browse files
panvaRafaelGSS
authored andcommitted
crypto: fix globalThis.crypto this check
PR-URL: #45857 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 97a8e05 commit f7dba5b

3 files changed

Lines changed: 14 additions & 10 deletions

File tree

lib/internal/process/pre_execution.js

Lines changed: 10 additions & 1 deletion

lib/internal/util.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,14 +552,17 @@ function defineLazyProperties(target, id, keys, enumerable = true) {
552552
ObjectDefineProperties(target, descriptors);
553553
}
554554

555-
function defineReplaceableLazyAttribute(target, id, keys, writable = true) {
555+
function defineReplaceableLazyAttribute(target, id, keys, writable = true, check) {
556556
let mod;
557557
for (let i = 0; i < keys.length; i++) {
558558
const key = keys[i];
559559
let value;
560560
let setterCalled = false;
561561

562562
function get() {
563+
if (check !== undefined) {
564+
FunctionPrototypeCall(check, this);
565+
}
563566
if (setterCalled) {
564567
return value;
565568
}

test/wpt/status/WebCryptoAPI.json

Lines changed: 0 additions & 8 deletions

0 commit comments

Comments
 (0)