Add debug logging for Undefined symbol errors in sx.js

Logs env keys (non-function) when a symbol lookup fails, to help
diagnose which component/context is missing the expected binding.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-04 15:45:32 +00:00
parent 715df11f82
commit 4939884f25

View File

@@ -418,6 +418,9 @@
if (name === "true") return true;
if (name === "false") return false;
if (name === "nil") return NIL;
// Debug: log env keys to help diagnose
var envKeys = Object.keys(env).filter(function(k) { return typeof env[k] !== "function"; }).slice(0, 20);
console.error("Undefined symbol: " + name + " | env keys (non-fn): " + envKeys.join(", "));
throw new Error("Undefined symbol: " + name);
}