From 2c762f47c9c8ece73ce6d430e7814cac9e031bab Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Thu, 6 Oct 2022 00:47:03 -0700 Subject: Add simple Hot Module Reloading to bun's runtime --- src/bun.js/api/server.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/bun.js/api/server.zig') diff --git a/src/bun.js/api/server.zig b/src/bun.js/api/server.zig index 23c961480..d93ca7ac6 100644 --- a/src/bun.js/api/server.zig +++ b/src/bun.js/api/server.zig @@ -2139,12 +2139,12 @@ pub fn NewServer(comptime ssl_enabled_: bool, comptime debug_mode_: bool) type { // only reload those two if (new_config.onRequest != .zero) { - this.config.onRequest = new_config.onRequest; this.config.onRequest.unprotect(); + this.config.onRequest = new_config.onRequest; } if (new_config.onError != .zero) { - this.config.onError = new_config.onError; this.config.onError.unprotect(); + this.config.onError = new_config.onError; } return this.thisObject.asObjectRef(); -- cgit v1.2.3