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 @@
12

View File

@@ -0,0 +1 @@
[1, 2, 3, 4, 5].filter(x => x > 2).reduce((a, b) => a + b, 0)

View File

@@ -0,0 +1 @@
2,4,6

View File

@@ -0,0 +1 @@
[1, 2, 3].map(x => x * 2).join(",")

View File

@@ -0,0 +1 @@
170

View File

@@ -0,0 +1 @@
[5, 2, 8, 1, 4].filter(x => x > 2).map(x => x * 10).reduce((a, b) => a + b, 0)

View File

@@ -0,0 +1 @@
99

View File

@@ -0,0 +1,3 @@
var a = [1, 2, 3];
a[0] = 99;
a[0]

View File

@@ -0,0 +1 @@
3

View File

@@ -0,0 +1,5 @@
var a = [];
a.push(1);
a.push(2);
a.push(3);
a.length

View File

@@ -0,0 +1 @@
5

View File

@@ -0,0 +1,2 @@
var o = { x: 5, get: function() { var f = () => this.x; return f(); } };
o.get()

View File

@@ -0,0 +1 @@
7

View File

@@ -0,0 +1,6 @@
class Point {
constructor(x, y) { this.x = x; this.y = y; }
sum() { return this.x + this.y; }
}
var p = new Point(3, 4);
p.sum()

View File

@@ -0,0 +1 @@
abc

View File

@@ -0,0 +1,5 @@
class A { a() { return "a"; } }
class B extends A { b() { return "b"; } }
class C extends B { c() { return this.a() + this.b() + "c"; } }
var c = new C();
c.c()

View File

@@ -0,0 +1 @@
woof

View File

@@ -0,0 +1,5 @@
class Animal { speak() { return "generic"; } }
class Dog extends Animal { speak() { return "woof"; } }
class Puppy extends Dog {}
var p = new Puppy();
p.speak()

View File

@@ -0,0 +1 @@
3

View File

@@ -0,0 +1,10 @@
function makeCounter() {
var n = 0;
return {
inc: function() { n = n + 1; return n; },
val: function() { return n; }
};
}
var c = makeCounter();
c.inc(); c.inc(); c.inc();
c.val()

View File

@@ -0,0 +1 @@
true

View File

@@ -0,0 +1,2 @@
var o = { x: 1, y: 2 };
('x' in o) && !('z' in o)

View File

@@ -0,0 +1 @@
true

View File

@@ -0,0 +1,4 @@
class A {}
class B extends A {}
var b = new B();
(b instanceof B) && (b instanceof A)

View File

@@ -0,0 +1 @@
5

View File

@@ -0,0 +1,2 @@
var o = { x: 5, getX: function() { return this.x; } };
o.getX()

View File

@@ -0,0 +1 @@
7

View File

@@ -0,0 +1,3 @@
function Point(x, y) { this.x = x; this.y = y; }
var p = new Point(3, 4);
p.x + p.y

View File

@@ -0,0 +1 @@
3

View File

@@ -0,0 +1,3 @@
var o = { x: 1 };
o.y = 2;
o.x + o.y

View File

@@ -0,0 +1 @@
7

View File

@@ -0,0 +1,4 @@
function Point(x, y) { this.x = x; this.y = y; }
Point.prototype.sum = function() { return this.x + this.y; };
var p = new Point(3, 4);
p.sum()

View File

@@ -0,0 +1 @@
HELLO-WORLD

View File

@@ -0,0 +1 @@
"Hello World".toUpperCase().split(" ").join("-")

View File

@@ -0,0 +1 @@
cde

View File

@@ -0,0 +1 @@
"abcdefg".slice(2, 5)