js: fix lambda binding (index-of on lists), add vectors + R7RS platform stubs
- Fix PRIMITIVES["index-of"] for arrays: return NIL when not found (matching OCaml semantics) so bind-lambda-params correctly detects absent &rest params. Previously String(array).indexOf() returned -1, which passed number? check and mis-fired the &rest branch, leaving non-&rest params unbound. - Declare var _lastErrorKont_ and var hostError in IIFE scope (strict mode fix) - Add PRIMITIVES["host-error"], ["try-catch"], ["without-io-hook"] - Add env["test-allowed?"] stub in run_tests.js - Add spec/tests/test-vectors.sx: 42 tests for all vector primitives - Rebuild sx-browser.js: 1847 standard / 2362 full tests pass (up from 5) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -293,6 +293,8 @@ env["pop-suite"] = function() {
|
||||
return null;
|
||||
};
|
||||
|
||||
env["test-allowed?"] = function(name) { return true; };
|
||||
|
||||
// Load test framework
|
||||
const projectDir = path.join(__dirname, "..", "..");
|
||||
const specTests = path.join(projectDir, "spec", "tests");
|
||||
|
||||
Reference in New Issue
Block a user