From 6305d4474de0657c90e4448130c42b8b59d9cea0 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Thu, 9 May 2019 21:01:05 +0000
Subject: [PATCH] Added todo comment about require() behavior which is
 unexpected when the passesd filename is not found - function reports the
 symbol was not defined rather than file not found or something similar.

---
 src/sbbs3/js_global.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/sbbs3/js_global.c b/src/sbbs3/js_global.c
index 7a58276e6e..90d7b5a324 100644
--- a/src/sbbs3/js_global.c
+++ b/src/sbbs3/js_global.c
@@ -723,6 +723,7 @@ js_require(JSContext *cx, uintN argc, jsval *arglist)
 
 	ret = js_load(cx, argc-1, arglist);
 
+	// TODO: this error is happening if the file doesn't exist!
 	if (!JS_HasProperty(cx, exec_obj, property, &found) || !found) {
 		JSVALUE_TO_MSTRING(cx, argv[fnarg], filename, NULL);
 		JS_ReportError(cx,"symbol '%s' not defined by script '%s'", property, filename);
-- 
GitLab