Skip to content

Commit e5b6d2d

Browse files
committed
crypto: update CryptoKey symbol properties
1 parent cf45a62 commit e5b6d2d

File tree

1 file changed

+30
-4
lines changed

1 file changed

+30
-4
lines changed

lib/internal/crypto/keys.js

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -718,10 +718,36 @@ class InternalCryptoKey {
718718
// Using symbol properties here currently instead of private
719719
// properties because (for now) the performance penalty of
720720
// private fields is still too high.
721-
this[kKeyObject] = keyObject;
722-
this[kAlgorithm] = algorithm;
723-
this[kExtractable] = extractable;
724-
this[kKeyUsages] = keyUsages;
721+
ObjectDefineProperties(this, {
722+
[kKeyObject]: {
723+
__proto__: null,
724+
value: keyObject,
725+
enumerable: false,
726+
configurable: false,
727+
writable: false,
728+
},
729+
[kAlgorithm]: {
730+
__proto__: null,
731+
value: algorithm,
732+
enumerable: false,
733+
configurable: false,
734+
writable: false,
735+
},
736+
[kExtractable]: {
737+
__proto__: null,
738+
value: extractable,
739+
enumerable: false,
740+
configurable: false,
741+
writable: false,
742+
},
743+
[kKeyUsages]: {
744+
__proto__: null,
745+
value: keyUsages,
746+
enumerable: false,
747+
configurable: false,
748+
writable: false,
749+
},
750+
});
725751
}
726752

727753
[kClone]() {

0 commit comments

Comments
 (0)