diff --git a/ext/node/polyfills/internal/crypto/keys.ts b/ext/node/polyfills/internal/crypto/keys.ts index 8cb9ab6906f11b..ca22e12c6197fd 100644 --- a/ext/node/polyfills/internal/crypto/keys.ts +++ b/ext/node/polyfills/internal/crypto/keys.ts @@ -4,6 +4,13 @@ // TODO(petamoriken): enable prefer-primordials for node polyfills // deno-lint-ignore-file prefer-primordials +import { primordials } from "ext:core/mod.js"; + +const { + ObjectDefineProperties, + SymbolToStringTag, +} = primordials; + import { op_node_create_private_key, op_node_create_public_key, @@ -209,6 +216,14 @@ export class KeyObject { } } +ObjectDefineProperties(KeyObject.prototype, { + [SymbolToStringTag]: { + __proto__: null, + configurable: true, + value: "KeyObject", + }, +}); + export interface JsonWebKeyInput { key: JsonWebKey; format: "jwk";