Skip to content
/ node Public
forked from nodejs/node

Commit

Permalink
crypto: add CryptoKey Symbol.toStringTag
Browse files Browse the repository at this point in the history
closes nodejs#45987

PR-URL: nodejs#46042
Backport-PR-URL: nodejs#46340
Fixes: nodejs#45987
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
  • Loading branch information
panva authored and juanarbol committed Jan 28, 2023
1 parent 742c5e2 commit 1a3cd21
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/internal/crypto/keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,15 @@ class InternalCryptoKey {
this[kExtractable] = extractable;
}
}

ObjectDefineProperties(CryptoKey.prototype, {
[SymbolToStringTag]: {
__proto__: null,
configurable: true,
value: 'CryptoKey',
},
});

InternalCryptoKey.prototype.constructor = CryptoKey;
ObjectSetPrototypeOf(InternalCryptoKey.prototype, CryptoKey.prototype);

Expand Down

0 comments on commit 1a3cd21

Please sign in to comment.