benjamn/es7-async-await

Esprima parse error

Closed this issue · 2 comments

I'm pretty certain I'm just doing something wrong, but I can't get the transform to work.

I have some sample code:

var req = require('fake-request');
var result = await req({some : 'body'});

And Esprima bombs on the await:

Error: Line 2: Unexpected identifier

I'm using Node v0.12.0:

I'm trying to transform like so:

es7-async-await test.js

Ah, yes, await is only treated as a keyword inside async functions.

Oh, thanks