js-on-sx: baseline commit (278/280 unit, 148/148 slice, runner stub)

Initial commit of the lib/js/ tree and plans/ directory. A previous
session left template-string work in progress — 278/280 unit tests pass
(2 failing: tpl part-count off-by-one, escaped-backtick ident lookup).
test262-runner.py and scoreboard are placeholders (0/8 with 7 timeouts);
fixing the runner is the next queue item.
This commit is contained in:
2026-04-23 19:42:16 +00:00
parent 14b6586e41
commit 9e568ad886
310 changed files with 7056 additions and 0 deletions

View File

@@ -0,0 +1 @@
42

View File

@@ -0,0 +1 @@
(x => x + 1)(41)

View File

@@ -0,0 +1 @@
22

View File

@@ -0,0 +1 @@
let f = x => { let y = x + 1; return y * 2; }; f(10)

View File

@@ -0,0 +1 @@
7

View File

@@ -0,0 +1 @@
(x => y => x + y)(3)(4)

View File

@@ -0,0 +1 @@
42

View File

@@ -0,0 +1 @@
(x => x)(42)

View File

@@ -0,0 +1 @@
7

View File

@@ -0,0 +1 @@
((a,b) => a + b)(3,4)

View File

@@ -0,0 +1 @@
42

View File

@@ -0,0 +1 @@
(() => 42)()

View File

@@ -0,0 +1 @@
21

View File

@@ -0,0 +1 @@
function compose(f, g) { return x => f(g(x)); } let addOne = x => x + 1; let double = x => x * 2; compose(addOne, double)(10)

View File

@@ -0,0 +1 @@
25

View File

@@ -0,0 +1 @@
function f(x = 10, y = 20) { return x + y; } f(5)

View File

@@ -0,0 +1 @@
42

View File

@@ -0,0 +1 @@
function add(a, b) { return a + b; } add(17, 25)

View File

@@ -0,0 +1 @@
81

View File

@@ -0,0 +1 @@
function twice(f, x) { return f(f(x)); } twice(n => n * n, 3)

View File

@@ -0,0 +1 @@
81

View File

@@ -0,0 +1 @@
(function(x) { return x * x; })(9)

View File

@@ -0,0 +1 @@
5

View File

@@ -0,0 +1 @@
Math.abs(-5)

View File

@@ -0,0 +1 @@
4

View File

@@ -0,0 +1 @@
Math.ceil(3.1)

View File

@@ -0,0 +1 @@
3

View File

@@ -0,0 +1 @@
Math.floor(3.9)

View File

@@ -0,0 +1 @@
5

View File

@@ -0,0 +1 @@
Math.max(1,5,3)

View File

@@ -0,0 +1 @@
1

View File

@@ -0,0 +1 @@
Math.min(1,5,3)

View File

@@ -0,0 +1 @@
true

View File

@@ -0,0 +1 @@
Math.PI > 3

View File

@@ -0,0 +1 @@
720

View File

@@ -0,0 +1 @@
function fact(n) { if (n <= 1) return 1; return n * fact(n - 1); } fact(6)

View File

@@ -0,0 +1 @@
144

View File

@@ -0,0 +1 @@
function fib(n) { if (n < 2) return n; return fib(n-1) + fib(n-2); } fib(12)

View File

@@ -0,0 +1 @@
21

View File

@@ -0,0 +1 @@
function sum(...xs) { let t = 0; for (let i = 0; i < xs.length; i = i + 1) t = t + xs[i]; return t; } sum(1,2,3,4,5,6)