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:
1
lib/js/test262-slice/promises/executor_throws.expected
Normal file
1
lib/js/test262-slice/promises/executor_throws.expected
Normal file
@@ -0,0 +1 @@
|
||||
bang
|
||||
4
lib/js/test262-slice/promises/executor_throws.js
Normal file
4
lib/js/test262-slice/promises/executor_throws.js
Normal file
@@ -0,0 +1,4 @@
|
||||
var r = null;
|
||||
new Promise((res, rej) => { throw "bang"; }).catch(e => { r = e; });
|
||||
__drain();
|
||||
r
|
||||
@@ -0,0 +1 @@
|
||||
1:5
|
||||
5
lib/js/test262-slice/promises/finally_passthrough.js
Normal file
5
lib/js/test262-slice/promises/finally_passthrough.js
Normal file
@@ -0,0 +1,5 @@
|
||||
var r = null;
|
||||
var hit = 0;
|
||||
Promise.resolve(5).finally(() => { hit = 1; }).then(v => { r = v; });
|
||||
__drain();
|
||||
"" + hit + ":" + r
|
||||
@@ -0,0 +1 @@
|
||||
A,B,C,D
|
||||
5
lib/js/test262-slice/promises/microtask_ordering.js
Normal file
5
lib/js/test262-slice/promises/microtask_ordering.js
Normal file
@@ -0,0 +1,5 @@
|
||||
var log = [];
|
||||
Promise.resolve(0).then(() => { log.push("A"); }).then(() => { log.push("C"); });
|
||||
Promise.resolve(0).then(() => { log.push("B"); }).then(() => { log.push("D"); });
|
||||
__drain();
|
||||
log.join(",")
|
||||
@@ -0,0 +1 @@
|
||||
oops
|
||||
4
lib/js/test262-slice/promises/new_promise_reject.js
Normal file
4
lib/js/test262-slice/promises/new_promise_reject.js
Normal file
@@ -0,0 +1,4 @@
|
||||
var r = null;
|
||||
new Promise((resolve, reject) => { reject("oops"); }).catch(e => { r = e; });
|
||||
__drain();
|
||||
r
|
||||
@@ -0,0 +1 @@
|
||||
42
|
||||
4
lib/js/test262-slice/promises/new_promise_resolve.js
Normal file
4
lib/js/test262-slice/promises/new_promise_resolve.js
Normal file
@@ -0,0 +1,4 @@
|
||||
var r = null;
|
||||
new Promise((resolve, reject) => { resolve(42); }).then(v => { r = v; });
|
||||
__drain();
|
||||
r
|
||||
1
lib/js/test262-slice/promises/promise_all.expected
Normal file
1
lib/js/test262-slice/promises/promise_all.expected
Normal file
@@ -0,0 +1 @@
|
||||
6
|
||||
5
lib/js/test262-slice/promises/promise_all.js
Normal file
5
lib/js/test262-slice/promises/promise_all.js
Normal file
@@ -0,0 +1,5 @@
|
||||
var r = null;
|
||||
Promise.all([Promise.resolve(1), Promise.resolve(2), Promise.resolve(3)])
|
||||
.then(vs => { r = vs[0] + vs[1] + vs[2]; });
|
||||
__drain();
|
||||
r
|
||||
1
lib/js/test262-slice/promises/promise_all_empty.expected
Normal file
1
lib/js/test262-slice/promises/promise_all_empty.expected
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
4
lib/js/test262-slice/promises/promise_all_empty.js
Normal file
4
lib/js/test262-slice/promises/promise_all_empty.js
Normal file
@@ -0,0 +1,4 @@
|
||||
var r = null;
|
||||
Promise.all([]).then(vs => { r = vs.length; });
|
||||
__drain();
|
||||
r
|
||||
@@ -0,0 +1 @@
|
||||
3
|
||||
4
lib/js/test262-slice/promises/promise_all_nonpromise.js
Normal file
4
lib/js/test262-slice/promises/promise_all_nonpromise.js
Normal file
@@ -0,0 +1,4 @@
|
||||
var r = null;
|
||||
Promise.all([1, 2, 3]).then(vs => { r = vs.length; });
|
||||
__drain();
|
||||
r
|
||||
@@ -0,0 +1 @@
|
||||
x
|
||||
5
lib/js/test262-slice/promises/promise_all_reject.js
Normal file
5
lib/js/test262-slice/promises/promise_all_reject.js
Normal file
@@ -0,0 +1,5 @@
|
||||
var r = null;
|
||||
Promise.all([Promise.resolve(1), Promise.reject("x"), Promise.resolve(3)])
|
||||
.catch(e => { r = e; });
|
||||
__drain();
|
||||
r
|
||||
1
lib/js/test262-slice/promises/promise_race.expected
Normal file
1
lib/js/test262-slice/promises/promise_race.expected
Normal file
@@ -0,0 +1 @@
|
||||
first
|
||||
5
lib/js/test262-slice/promises/promise_race.js
Normal file
5
lib/js/test262-slice/promises/promise_race.js
Normal file
@@ -0,0 +1,5 @@
|
||||
var r = null;
|
||||
Promise.race([Promise.resolve("first"), Promise.resolve("second")])
|
||||
.then(v => { r = v; });
|
||||
__drain();
|
||||
r
|
||||
@@ -0,0 +1 @@
|
||||
true
|
||||
@@ -0,0 +1,3 @@
|
||||
var p1 = Promise.resolve(5);
|
||||
var p2 = Promise.resolve(p1);
|
||||
p1 === p2
|
||||
1
lib/js/test262-slice/promises/reject_catch.expected
Normal file
1
lib/js/test262-slice/promises/reject_catch.expected
Normal file
@@ -0,0 +1 @@
|
||||
bad
|
||||
4
lib/js/test262-slice/promises/reject_catch.js
Normal file
4
lib/js/test262-slice/promises/reject_catch.js
Normal file
@@ -0,0 +1,4 @@
|
||||
var msg = null;
|
||||
Promise.reject("bad").catch(e => { msg = e; });
|
||||
__drain();
|
||||
msg
|
||||
1
lib/js/test262-slice/promises/resolve_adopts.expected
Normal file
1
lib/js/test262-slice/promises/resolve_adopts.expected
Normal file
@@ -0,0 +1 @@
|
||||
77
|
||||
5
lib/js/test262-slice/promises/resolve_adopts.js
Normal file
5
lib/js/test262-slice/promises/resolve_adopts.js
Normal file
@@ -0,0 +1,5 @@
|
||||
var r = null;
|
||||
var inner = Promise.resolve(77);
|
||||
new Promise((res, rej) => { res(inner); }).then(v => { r = v; });
|
||||
__drain();
|
||||
r
|
||||
1
lib/js/test262-slice/promises/resolve_then.expected
Normal file
1
lib/js/test262-slice/promises/resolve_then.expected
Normal file
@@ -0,0 +1 @@
|
||||
8
|
||||
4
lib/js/test262-slice/promises/resolve_then.js
Normal file
4
lib/js/test262-slice/promises/resolve_then.js
Normal file
@@ -0,0 +1,4 @@
|
||||
var r = null;
|
||||
Promise.resolve(7).then(x => { r = x + 1; });
|
||||
__drain();
|
||||
r
|
||||
1
lib/js/test262-slice/promises/then_chain.expected
Normal file
1
lib/js/test262-slice/promises/then_chain.expected
Normal file
@@ -0,0 +1 @@
|
||||
20
|
||||
4
lib/js/test262-slice/promises/then_chain.js
Normal file
4
lib/js/test262-slice/promises/then_chain.js
Normal file
@@ -0,0 +1,4 @@
|
||||
var r = null;
|
||||
Promise.resolve(1).then(x => x + 1).then(x => x * 10).then(x => { r = x; });
|
||||
__drain();
|
||||
r
|
||||
1
lib/js/test262-slice/promises/then_throw_catch.expected
Normal file
1
lib/js/test262-slice/promises/then_throw_catch.expected
Normal file
@@ -0,0 +1 @@
|
||||
boom
|
||||
6
lib/js/test262-slice/promises/then_throw_catch.js
Normal file
6
lib/js/test262-slice/promises/then_throw_catch.js
Normal file
@@ -0,0 +1,6 @@
|
||||
var r = null;
|
||||
Promise.resolve(1)
|
||||
.then(x => { throw "boom"; })
|
||||
.catch(e => { r = e; });
|
||||
__drain();
|
||||
r
|
||||
Reference in New Issue
Block a user