unassert-js / unassert

Encourages programming with assertions by providing tools to compile them away.
MIT License
192 stars 13 forks source link

Can't parse es2017 and later #12

Open falsandtru opened 6 years ago

falsandtru commented 6 years ago

Acorn targets es2016 by default, not es2017 or later. You have to specify the version.

https://github.com/acornjs/acorn#main-parser

twada commented 6 years ago

@falsandtru Sorry for my late response. I'll take a look.

To give you a quick fix, could you tell me what transpiler-side product are you using?

I'll fix it first.

falsandtru commented 6 years ago

I'm using gulp-unassert.

twada commented 6 years ago

While tackling with this issue, I've found that escodegen cannot generate for-await-of statement so I made a PR to fix. Please wait for a moment.

refs: Support async iteration statement for-await-of introduced in ES2018

falsandtru commented 6 years ago

Now gulp-unassert can work with es2018, thanks!