Skip to content

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 <duhamelantoine1995@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
  • 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
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.