tildefriends/tests/10-await
2016-07-24 17:02:45 +00:00

24 lines
292 B
Bash

#!/bin/bash
cat > test.js << EOF
print("hi");
function foobar() {
return new Promise(function (resolve, reject) {
resolve(10);
});
}
async function huh() {
let v = await foobar();
print("v => " + v);
if (v != 10) {
throw new Error("nope");
}
}
huh();
EOF
$TILDEFRIENDS test.js