From c2a77cf7ec9de9eadf938046bdf78e58561c8a6d Mon Sep 17 00:00:00 2001 From: dave caruso Date: Wed, 2 Aug 2023 16:27:36 -0700 Subject: 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> --- src/js/node/net.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/js/node/net.js') diff --git a/src/js/node/net.js b/src/js/node/net.js index 5501d327b..0513f44d3 100644 --- a/src/js/node/net.js +++ b/src/js/node/net.js @@ -19,8 +19,8 @@ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -import { Duplex } from "node:stream"; -import { EventEmitter } from "node:events"; +const { Duplex } = require("node:stream"); +const EventEmitter = require("node:events"); // IPv4 Segment const v4Seg = "(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])"; @@ -56,7 +56,6 @@ function isIP(s) { return 0; } -const { Bun, createFIFO, Object } = $lazy("primordials"); const { connect: bunConnect } = Bun; var { setTimeout } = globalThis; @@ -294,7 +293,7 @@ const Socket = (function (InternalSocket) { #closed = false; connecting = false; localAddress = "127.0.0.1"; - #readQueue = createFIFO(); + #readQueue = $createFIFO(); remotePort; [bunSocketInternal] = null; [bunTLSConnectOptions] = null; @@ -891,8 +890,5 @@ export default { isIPv4, isIPv6, Socket, - [Symbol.for("CommonJS")]: 0, [Symbol.for("::bunternal::")]: SocketClass, }; - -export { createServer, Server, createConnection, connect, isIP, isIPv4, isIPv6, Socket }; -- cgit v1.2.3