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:
@@ -0,0 +1 @@
|
||||
12
|
||||
1
lib/js/test262-slice/objects/array_filter_reduce.js
Normal file
1
lib/js/test262-slice/objects/array_filter_reduce.js
Normal file
@@ -0,0 +1 @@
|
||||
[1, 2, 3, 4, 5].filter(x => x > 2).reduce((a, b) => a + b, 0)
|
||||
1
lib/js/test262-slice/objects/array_map.expected
Normal file
1
lib/js/test262-slice/objects/array_map.expected
Normal file
@@ -0,0 +1 @@
|
||||
2,4,6
|
||||
1
lib/js/test262-slice/objects/array_map.js
Normal file
1
lib/js/test262-slice/objects/array_map.js
Normal file
@@ -0,0 +1 @@
|
||||
[1, 2, 3].map(x => x * 2).join(",")
|
||||
1
lib/js/test262-slice/objects/array_method_chain.expected
Normal file
1
lib/js/test262-slice/objects/array_method_chain.expected
Normal file
@@ -0,0 +1 @@
|
||||
170
|
||||
1
lib/js/test262-slice/objects/array_method_chain.js
Normal file
1
lib/js/test262-slice/objects/array_method_chain.js
Normal file
@@ -0,0 +1 @@
|
||||
[5, 2, 8, 1, 4].filter(x => x > 2).map(x => x * 10).reduce((a, b) => a + b, 0)
|
||||
1
lib/js/test262-slice/objects/array_mutate.expected
Normal file
1
lib/js/test262-slice/objects/array_mutate.expected
Normal file
@@ -0,0 +1 @@
|
||||
99
|
||||
3
lib/js/test262-slice/objects/array_mutate.js
Normal file
3
lib/js/test262-slice/objects/array_mutate.js
Normal file
@@ -0,0 +1,3 @@
|
||||
var a = [1, 2, 3];
|
||||
a[0] = 99;
|
||||
a[0]
|
||||
1
lib/js/test262-slice/objects/array_push_length.expected
Normal file
1
lib/js/test262-slice/objects/array_push_length.expected
Normal file
@@ -0,0 +1 @@
|
||||
3
|
||||
5
lib/js/test262-slice/objects/array_push_length.js
Normal file
5
lib/js/test262-slice/objects/array_push_length.js
Normal file
@@ -0,0 +1,5 @@
|
||||
var a = [];
|
||||
a.push(1);
|
||||
a.push(2);
|
||||
a.push(3);
|
||||
a.length
|
||||
1
lib/js/test262-slice/objects/arrow_lexical_this.expected
Normal file
1
lib/js/test262-slice/objects/arrow_lexical_this.expected
Normal file
@@ -0,0 +1 @@
|
||||
5
|
||||
2
lib/js/test262-slice/objects/arrow_lexical_this.js
Normal file
2
lib/js/test262-slice/objects/arrow_lexical_this.js
Normal file
@@ -0,0 +1,2 @@
|
||||
var o = { x: 5, get: function() { var f = () => this.x; return f(); } };
|
||||
o.get()
|
||||
1
lib/js/test262-slice/objects/class_basic.expected
Normal file
1
lib/js/test262-slice/objects/class_basic.expected
Normal file
@@ -0,0 +1 @@
|
||||
7
|
||||
6
lib/js/test262-slice/objects/class_basic.js
Normal file
6
lib/js/test262-slice/objects/class_basic.js
Normal 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()
|
||||
1
lib/js/test262-slice/objects/class_extend_chain.expected
Normal file
1
lib/js/test262-slice/objects/class_extend_chain.expected
Normal file
@@ -0,0 +1 @@
|
||||
abc
|
||||
5
lib/js/test262-slice/objects/class_extend_chain.js
Normal file
5
lib/js/test262-slice/objects/class_extend_chain.js
Normal 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()
|
||||
1
lib/js/test262-slice/objects/class_inherit.expected
Normal file
1
lib/js/test262-slice/objects/class_inherit.expected
Normal file
@@ -0,0 +1 @@
|
||||
woof
|
||||
5
lib/js/test262-slice/objects/class_inherit.js
Normal file
5
lib/js/test262-slice/objects/class_inherit.js
Normal 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()
|
||||
1
lib/js/test262-slice/objects/counter_closure.expected
Normal file
1
lib/js/test262-slice/objects/counter_closure.expected
Normal file
@@ -0,0 +1 @@
|
||||
3
|
||||
10
lib/js/test262-slice/objects/counter_closure.js
Normal file
10
lib/js/test262-slice/objects/counter_closure.js
Normal 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()
|
||||
1
lib/js/test262-slice/objects/in_operator.expected
Normal file
1
lib/js/test262-slice/objects/in_operator.expected
Normal file
@@ -0,0 +1 @@
|
||||
true
|
||||
2
lib/js/test262-slice/objects/in_operator.js
Normal file
2
lib/js/test262-slice/objects/in_operator.js
Normal file
@@ -0,0 +1,2 @@
|
||||
var o = { x: 1, y: 2 };
|
||||
('x' in o) && !('z' in o)
|
||||
1
lib/js/test262-slice/objects/instanceof.expected
Normal file
1
lib/js/test262-slice/objects/instanceof.expected
Normal file
@@ -0,0 +1 @@
|
||||
true
|
||||
4
lib/js/test262-slice/objects/instanceof.js
Normal file
4
lib/js/test262-slice/objects/instanceof.js
Normal file
@@ -0,0 +1,4 @@
|
||||
class A {}
|
||||
class B extends A {}
|
||||
var b = new B();
|
||||
(b instanceof B) && (b instanceof A)
|
||||
1
lib/js/test262-slice/objects/method_this.expected
Normal file
1
lib/js/test262-slice/objects/method_this.expected
Normal file
@@ -0,0 +1 @@
|
||||
5
|
||||
2
lib/js/test262-slice/objects/method_this.js
Normal file
2
lib/js/test262-slice/objects/method_this.js
Normal file
@@ -0,0 +1,2 @@
|
||||
var o = { x: 5, getX: function() { return this.x; } };
|
||||
o.getX()
|
||||
1
lib/js/test262-slice/objects/new_constructor.expected
Normal file
1
lib/js/test262-slice/objects/new_constructor.expected
Normal file
@@ -0,0 +1 @@
|
||||
7
|
||||
3
lib/js/test262-slice/objects/new_constructor.js
Normal file
3
lib/js/test262-slice/objects/new_constructor.js
Normal 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
|
||||
1
lib/js/test262-slice/objects/object_mutate.expected
Normal file
1
lib/js/test262-slice/objects/object_mutate.expected
Normal file
@@ -0,0 +1 @@
|
||||
3
|
||||
3
lib/js/test262-slice/objects/object_mutate.js
Normal file
3
lib/js/test262-slice/objects/object_mutate.js
Normal file
@@ -0,0 +1,3 @@
|
||||
var o = { x: 1 };
|
||||
o.y = 2;
|
||||
o.x + o.y
|
||||
1
lib/js/test262-slice/objects/prototype_chain.expected
Normal file
1
lib/js/test262-slice/objects/prototype_chain.expected
Normal file
@@ -0,0 +1 @@
|
||||
7
|
||||
4
lib/js/test262-slice/objects/prototype_chain.js
vendored
Normal file
4
lib/js/test262-slice/objects/prototype_chain.js
vendored
Normal 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()
|
||||
1
lib/js/test262-slice/objects/string_method.expected
Normal file
1
lib/js/test262-slice/objects/string_method.expected
Normal file
@@ -0,0 +1 @@
|
||||
HELLO-WORLD
|
||||
1
lib/js/test262-slice/objects/string_method.js
Normal file
1
lib/js/test262-slice/objects/string_method.js
Normal file
@@ -0,0 +1 @@
|
||||
"Hello World".toUpperCase().split(" ").join("-")
|
||||
1
lib/js/test262-slice/objects/string_slice.expected
Normal file
1
lib/js/test262-slice/objects/string_slice.expected
Normal file
@@ -0,0 +1 @@
|
||||
cde
|
||||
1
lib/js/test262-slice/objects/string_slice.js
Normal file
1
lib/js/test262-slice/objects/string_slice.js
Normal file
@@ -0,0 +1 @@
|
||||
"abcdefg".slice(2, 5)
|
||||
Reference in New Issue
Block a user