mirror of
https://github.com/oven-sh/bun
synced 2026-02-17 14:22:01 +00:00
use ERR_TLS_INVALID_PROTOCOL_VERSION new signature
This commit is contained in:
5
src/js/builtins.d.ts
vendored
5
src/js/builtins.d.ts
vendored
@@ -681,10 +681,7 @@ declare function $ERR_MISSING_ARGS(...args: [string, ...string[]]): TypeError;
|
||||
*/
|
||||
declare function $ERR_MISSING_ARGS(oneOf: string[]): TypeError;
|
||||
declare function $ERR_INVALID_RETURN_VALUE(expected_type: string, name: string, actual_value: any): TypeError;
|
||||
declare function $ERR_TLS_INVALID_PROTOCOL_VERSION(
|
||||
a: import("tls").SecureVersion | (string & {}),
|
||||
b: "maximum" | "minimum",
|
||||
): TypeError;
|
||||
declare function $ERR_TLS_INVALID_PROTOCOL_VERSION(a: import("tls").SecureVersion, b: "maximum" | "minimum"): TypeError;
|
||||
declare function $ERR_TLS_PROTOCOL_VERSION_CONFLICT(a: string, b: string): TypeError;
|
||||
declare function $ERR_INVALID_IP_ADDRESS(ip: any): TypeError;
|
||||
declare function $ERR_INVALID_ADDRESS_FAMILY(addressType, host, port): RangeError;
|
||||
|
||||
@@ -322,8 +322,8 @@ var InternalSecureContext = class SecureContext {
|
||||
);
|
||||
}
|
||||
|
||||
let minVersionName;
|
||||
let maxVersionName;
|
||||
let minVersionName: SecureVersion | undefined;
|
||||
let maxVersionName: SecureVersion | undefined;
|
||||
|
||||
if (hasSecureProtocol) {
|
||||
if (typeof secureProtocol !== "string") {
|
||||
@@ -361,9 +361,7 @@ var InternalSecureContext = class SecureContext {
|
||||
throw $ERR_INVALID_ARG_TYPE("options.minVersion", "string", minVersionName);
|
||||
}
|
||||
if (!(minVersionName in TLS_VERSION_MAP)) {
|
||||
const err = new TypeError(`The value "${minVersionName}" is invalid for option "minVersion"`);
|
||||
err.code = "ERR_TLS_INVALID_PROTOCOL_VERSION";
|
||||
throw err;
|
||||
throw $ERR_TLS_INVALID_PROTOCOL_VERSION(minVersionName, "minimum");
|
||||
}
|
||||
}
|
||||
this.minVersion = TLS_VERSION_MAP[minVersionName];
|
||||
@@ -373,9 +371,7 @@ var InternalSecureContext = class SecureContext {
|
||||
throw $ERR_INVALID_ARG_TYPE("options.maxVersion", "string", maxVersionName);
|
||||
}
|
||||
if (!(maxVersionName in TLS_VERSION_MAP)) {
|
||||
const err = new TypeError(`The value "${maxVersionName}" is invalid for option "maxVersion"`);
|
||||
err.code = "ERR_TLS_INVALID_PROTOCOL_VERSION";
|
||||
throw err;
|
||||
throw $ERR_TLS_INVALID_PROTOCOL_VERSION(maxVersionName, "maximum");
|
||||
}
|
||||
}
|
||||
this.maxVersion = TLS_VERSION_MAP[maxVersionName];
|
||||
|
||||
Reference in New Issue
Block a user