Node6: Remove parentheses around the body of async arrow functions (#942)

This commit is contained in:
JoelEinbinder
2017-10-02 18:25:11 -07:00
committed by GitHub
parent dc4c8786e3
commit d87480b609
2 changed files with 18 additions and 0 deletions

View File

@@ -70,4 +70,10 @@ describe('TransformAsyncFunctions', function() {
expect(output instanceof Promise).toBe(true);
output.then(result => expect(result).toBe(123)).then(done);
});
it('should work paren around arrow function', function(done) {
const input = `(async x => ( 123))()`;
const output = eval(transformAsyncFunctions(input));
expect(output instanceof Promise).toBe(true);
output.then(result => expect(result).toBe(123)).then(done);
});
});