From 1a3cd21f8c38473bc4f0ee4b02de76330c317478 Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Wed, 18 Jan 2023 19:07:26 +0100 Subject: [PATCH] crypto: add CryptoKey Symbol.toStringTag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes #45987 PR-URL: https://github.com/nodejs/node/pull/46042 Backport-PR-URL: https://github.com/nodejs/node/pull/46340 Fixes: https://github.com/nodejs/node/issues/45987 Reviewed-By: Antoine du Hamel Reviewed-By: Tobias Nießen Reviewed-By: Juan José Arboleda --- lib/internal/crypto/keys.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/internal/crypto/keys.js b/lib/internal/crypto/keys.js index bb7dd7dbd0d1eb..3304615f4c110a 100644 --- a/lib/internal/crypto/keys.js +++ b/lib/internal/crypto/keys.js @@ -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);