1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-11 00:21:05 -05:00

fix(ext/node): add Symbol.toStringTag to KeyObject instances (#24377)

As per https://github.com/nodejs/node/pull/46043, this adds
Symbol.toStringTag getter to KeyObject.
This commit is contained in:
Filip Skokan 2024-07-02 00:36:22 +02:00 committed by GitHub
parent 6f30ef88a2
commit 740c6a0998
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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";