diff options
author | 2023-08-02 16:27:36 -0700 | |
---|---|---|
committer | 2023-08-02 16:27:36 -0700 | |
commit | c2a77cf7ec9de9eadf938046bdf78e58561c8a6d (patch) | |
tree | 0f90f1b323061455875333c9f40592b303585973 /src/js/node/tls.js | |
parent | 7656b4b17e91f15b58eeab8f45b78c416ec6a045 (diff) | |
download | bun-c2a77cf7ec9de9eadf938046bdf78e58561c8a6d.tar.gz bun-c2a77cf7ec9de9eadf938046bdf78e58561c8a6d.tar.zst bun-c2a77cf7ec9de9eadf938046bdf78e58561c8a6d.zip |
Rewrite built-in modules to use CommonJS over ESM (#3814)
* stfdsafsd
sadffdsa
stuff
finish commonjs stuff
asdf
not done but work
not done but work
not done yet but this is how far i am
remove files
lol
update built files
uncomment everything in events lol
export default
stuff
* afdsafsd
* its not perfect but almost done
* okay
* cool
* remove temp file
* finish rebase
* revert settings.json
* a
* ch-ch-ch-ch-changes
* okay
* remove this check in release for now
* sxdcfghnjm,
* lkjhgf
* fmt
* filename can be null
* Update NodeModuleModule.h
* weee
* fmt
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'src/js/node/tls.js')
-rw-r--r-- | src/js/node/tls.js | 40 |
1 files changed, 4 insertions, 36 deletions
diff --git a/src/js/node/tls.js b/src/js/node/tls.js index 567baddc1..fc2d9065a 100644 --- a/src/js/node/tls.js +++ b/src/js/node/tls.js @@ -1,11 +1,8 @@ // Hardcoded module "node:tls" -import { isArrayBufferView, isTypedArray } from "util/types"; -import net, { Server as NetServer } from "node:net"; -const InternalTCPSocket = net[Symbol.for("::bunternal::")]; +const { isArrayBufferView, isTypedArray } = require("node:util/types"); +const net = require("node:net"); +const { Server: NetServer, [Symbol.for("::bunternal::")]: InternalTCPSocket } = net; const bunSocketInternal = Symbol.for("::bunnetsocketinternal::"); - -const { RegExp, Array, String } = $lazy("primordials"); - const { rootCertificates, canonicalizeIP } = $lazy("internal/tls"); const SymbolReplace = Symbol.replace; @@ -628,10 +625,6 @@ function getCiphers() { return DEFAULT_CIPHERS.split(":"); } -function getCurves() { - return; -} - // Convert protocols array into valid OpenSSL protocols list // ("\x06spdy/2\x08http/1.1\x08http/1.0") function convertProtocols(protocols) { @@ -682,8 +675,7 @@ function convertALPNProtocols(protocols, out) { } } -var exports = { - [Symbol.for("CommonJS")]: 0, +export default { CLIENT_RENEG_LIMIT, CLIENT_RENEG_WINDOW, connect, @@ -696,7 +688,6 @@ var exports = { DEFAULT_MAX_VERSION, DEFAULT_MIN_VERSION, getCiphers, - getCurves, parseCertString, SecureContext, Server, @@ -704,26 +695,3 @@ var exports = { checkServerIdentity, rootCertificates, }; - -export { - CLIENT_RENEG_LIMIT, - CLIENT_RENEG_WINDOW, - connect, - convertALPNProtocols, - createConnection, - createSecureContext, - createServer, - DEFAULT_CIPHERS, - DEFAULT_ECDH_CURVE, - DEFAULT_MAX_VERSION, - DEFAULT_MIN_VERSION, - getCiphers, - getCurves, - parseCertString, - SecureContext, - checkServerIdentity, - Server, - TLSSocket, - rootCertificates, - exports as default, -}; |