Justin Ridgewell 5ea1bfe780
Do not optimize away async/gen arrow functions (#7319)
* Do not optimize away async/gen arrow functions

* Node version 8
2018-02-03 17:08:12 -05:00

14 lines
206 B
JavaScript

function then(fn) {
return async (value) => {
return fn(await value);
};
}
var result = 1
|> (async (x) => await x + 1)
|> then((x) => x + 1);
result.then(val => {
assert.equal(val, 3);
});