mirror of
https://github.com/denoland/deno.git
synced 2024-11-28 16:20:57 -05:00
feat(ext/node): export missing symbols from domain, puncode, repl, tls (#25585)
This commit is contained in:
parent
3f6605d123
commit
3a3837545c
6 changed files with 96 additions and 2 deletions
|
@ -157,7 +157,72 @@ export function executionAsyncResource() {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
export const asyncWrapProviders = ObjectFreeze({ __proto__: null });
|
export const asyncWrapProviders = ObjectFreeze({
|
||||||
|
__proto__: null,
|
||||||
|
NONE: 0,
|
||||||
|
DIRHANDLE: 1,
|
||||||
|
DNSCHANNEL: 2,
|
||||||
|
ELDHISTOGRAM: 3,
|
||||||
|
FILEHANDLE: 4,
|
||||||
|
FILEHANDLECLOSEREQ: 5,
|
||||||
|
BLOBREADER: 6,
|
||||||
|
FSEVENTWRAP: 7,
|
||||||
|
FSREQCALLBACK: 8,
|
||||||
|
FSREQPROMISE: 9,
|
||||||
|
GETADDRINFOREQWRAP: 10,
|
||||||
|
GETNAMEINFOREQWRAP: 11,
|
||||||
|
HEAPSNAPSHOT: 12,
|
||||||
|
HTTP2SESSION: 13,
|
||||||
|
HTTP2STREAM: 14,
|
||||||
|
HTTP2PING: 15,
|
||||||
|
HTTP2SETTINGS: 16,
|
||||||
|
HTTPINCOMINGMESSAGE: 17,
|
||||||
|
HTTPCLIENTREQUEST: 18,
|
||||||
|
JSSTREAM: 19,
|
||||||
|
JSUDPWRAP: 20,
|
||||||
|
MESSAGEPORT: 21,
|
||||||
|
PIPECONNECTWRAP: 22,
|
||||||
|
PIPESERVERWRAP: 23,
|
||||||
|
PIPEWRAP: 24,
|
||||||
|
PROCESSWRAP: 25,
|
||||||
|
PROMISE: 26,
|
||||||
|
QUERYWRAP: 27,
|
||||||
|
QUIC_ENDPOINT: 28,
|
||||||
|
QUIC_LOGSTREAM: 29,
|
||||||
|
QUIC_PACKET: 30,
|
||||||
|
QUIC_SESSION: 31,
|
||||||
|
QUIC_STREAM: 32,
|
||||||
|
QUIC_UDP: 33,
|
||||||
|
SHUTDOWNWRAP: 34,
|
||||||
|
SIGNALWRAP: 35,
|
||||||
|
STATWATCHER: 36,
|
||||||
|
STREAMPIPE: 37,
|
||||||
|
TCPCONNECTWRAP: 38,
|
||||||
|
TCPSERVERWRAP: 39,
|
||||||
|
TCPWRAP: 40,
|
||||||
|
TTYWRAP: 41,
|
||||||
|
UDPSENDWRAP: 42,
|
||||||
|
UDPWRAP: 43,
|
||||||
|
SIGINTWATCHDOG: 44,
|
||||||
|
WORKER: 45,
|
||||||
|
WORKERHEAPSNAPSHOT: 46,
|
||||||
|
WRITEWRAP: 47,
|
||||||
|
ZLIB: 48,
|
||||||
|
CHECKPRIMEREQUEST: 49,
|
||||||
|
PBKDF2REQUEST: 50,
|
||||||
|
KEYPAIRGENREQUEST: 51,
|
||||||
|
KEYGENREQUEST: 52,
|
||||||
|
KEYEXPORTREQUEST: 53,
|
||||||
|
CIPHERREQUEST: 54,
|
||||||
|
DERIVEBITSREQUEST: 55,
|
||||||
|
HASHREQUEST: 56,
|
||||||
|
RANDOMBYTESREQUEST: 57,
|
||||||
|
RANDOMPRIMEREQUEST: 58,
|
||||||
|
SCRYPTREQUEST: 59,
|
||||||
|
SIGNREQUEST: 60,
|
||||||
|
TLSWRAP: 61,
|
||||||
|
VERIFYREQUEST: 62,
|
||||||
|
});
|
||||||
|
|
||||||
class AsyncHook {
|
class AsyncHook {
|
||||||
enable() {
|
enable() {
|
||||||
|
|
|
@ -15,9 +15,20 @@ function emitError(e) {
|
||||||
this.emit("error", e);
|
this.emit("error", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(bartlomieju): maybe use this one
|
||||||
|
// deno-lint-ignore prefer-const
|
||||||
|
let stack = [];
|
||||||
|
export const _stack = stack;
|
||||||
|
export const active = null;
|
||||||
|
|
||||||
export function create() {
|
export function create() {
|
||||||
return new Domain();
|
return new Domain();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function createDomain() {
|
||||||
|
return new Domain();
|
||||||
|
}
|
||||||
|
|
||||||
export class Domain extends EventEmitter {
|
export class Domain extends EventEmitter {
|
||||||
#handler;
|
#handler;
|
||||||
|
|
||||||
|
@ -85,6 +96,9 @@ export class Domain extends EventEmitter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export default {
|
export default {
|
||||||
|
_stack,
|
||||||
create,
|
create,
|
||||||
|
active,
|
||||||
|
createDomain,
|
||||||
Domain,
|
Domain,
|
||||||
};
|
};
|
||||||
|
|
|
@ -2606,6 +2606,7 @@ export default {
|
||||||
constants,
|
constants,
|
||||||
isAscii,
|
isAscii,
|
||||||
isUtf8,
|
isUtf8,
|
||||||
|
INSPECT_MAX_BYTES,
|
||||||
kMaxLength,
|
kMaxLength,
|
||||||
kStringMaxLength,
|
kStringMaxLength,
|
||||||
SlowBuffer,
|
SlowBuffer,
|
||||||
|
|
|
@ -11,6 +11,8 @@ import { deprecate } from "node:util";
|
||||||
|
|
||||||
import { ucs2 } from "ext:deno_node/internal/idna.ts";
|
import { ucs2 } from "ext:deno_node/internal/idna.ts";
|
||||||
|
|
||||||
|
const version = "2.1.0";
|
||||||
|
|
||||||
// deno-lint-ignore no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
function punyDeprecated(fn: any) {
|
function punyDeprecated(fn: any) {
|
||||||
return deprecate(
|
return deprecate(
|
||||||
|
@ -37,7 +39,7 @@ function encode(domain) {
|
||||||
return punyDeprecated(op_node_idna_punycode_encode)(domain);
|
return punyDeprecated(op_node_idna_punycode_encode)(domain);
|
||||||
}
|
}
|
||||||
|
|
||||||
export { decode, encode, toASCII, toUnicode, ucs2 };
|
export { decode, encode, toASCII, toUnicode, ucs2, version };
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
decode,
|
decode,
|
||||||
|
@ -45,4 +47,5 @@ export default {
|
||||||
toASCII,
|
toASCII,
|
||||||
toUnicode,
|
toUnicode,
|
||||||
ucs2,
|
ucs2,
|
||||||
|
version,
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,12 @@
|
||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
// Copyright Joyent and Node contributors. All rights reserved. MIT license.
|
// Copyright Joyent and Node contributors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
import { primordials } from "ext:core/mod.js";
|
||||||
import { notImplemented } from "ext:deno_node/_utils.ts";
|
import { notImplemented } from "ext:deno_node/_utils.ts";
|
||||||
|
const { Symbol } = primordials;
|
||||||
|
|
||||||
|
export const REPL_MODE_SLOPPY = Symbol("repl-sloppy");
|
||||||
|
export const REPL_MODE_STRICT = Symbol("repl-strict");
|
||||||
|
|
||||||
export class REPLServer {
|
export class REPLServer {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -61,4 +66,6 @@ export default {
|
||||||
builtinModules,
|
builtinModules,
|
||||||
_builtinLibs,
|
_builtinLibs,
|
||||||
start,
|
start,
|
||||||
|
REPL_MODE_SLOPPY,
|
||||||
|
REPL_MODE_STRICT,
|
||||||
};
|
};
|
||||||
|
|
|
@ -34,6 +34,8 @@ export const rootCertificates = undefined;
|
||||||
export const DEFAULT_ECDH_CURVE = "auto";
|
export const DEFAULT_ECDH_CURVE = "auto";
|
||||||
export const DEFAULT_MAX_VERSION = "TLSv1.3";
|
export const DEFAULT_MAX_VERSION = "TLSv1.3";
|
||||||
export const DEFAULT_MIN_VERSION = "TLSv1.2";
|
export const DEFAULT_MIN_VERSION = "TLSv1.2";
|
||||||
|
export const CLIENT_RENEG_LIMIT = 3;
|
||||||
|
export const CLIENT_RENEG_WINDOW = 600;
|
||||||
|
|
||||||
export class CryptoStream {}
|
export class CryptoStream {}
|
||||||
export class SecurePair {}
|
export class SecurePair {}
|
||||||
|
@ -58,6 +60,8 @@ export default {
|
||||||
DEFAULT_ECDH_CURVE,
|
DEFAULT_ECDH_CURVE,
|
||||||
DEFAULT_MAX_VERSION,
|
DEFAULT_MAX_VERSION,
|
||||||
DEFAULT_MIN_VERSION,
|
DEFAULT_MIN_VERSION,
|
||||||
|
CLIENT_RENEG_LIMIT,
|
||||||
|
CLIENT_RENEG_WINDOW,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const checkServerIdentity = tlsWrap.checkServerIdentity;
|
export const checkServerIdentity = tlsWrap.checkServerIdentity;
|
||||||
|
|
Loading…
Reference in a new issue