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:
parent
6f30ef88a2
commit
740c6a0998
1 changed files with 15 additions and 0 deletions
|
@ -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";
|
||||
|
|
Loading…
Reference in a new issue