seanmonstar / insist

A drop-in replacement for `assert` with a better default message.
Mozilla Public License 2.0
32 stars 4 forks source link

make compatible with older js engines #3

Open djulien opened 9 years ago

djulien commented 9 years ago

Replaced "const" with "var" so it can be used with older js engines. (I'm using a recent js engine, but a nested esprima module is using older syntax rules so it doesn't like the consts)

seanmonstar commented 9 years ago

This makes me sad. esprima cannot parse the const keyword?

djulien commented 9 years ago

Well, the version that came down when I did an npm install for insist didn't like "const" - the package.json dependencies show esprima version ~1.0.4. However, I see that https://github.com/jquery/esprima is up to version 2.6.0 now, so maybe a newer version would fix it.

seanmonstar commented 9 years ago

I've just published v1.0.0, that updates that dependency on esprima to ^2.0. Does that fix this?

djulien commented 9 years ago

It works with const okay now. thanks

I'm also getting an error from esprima when I use a she-bang file, but I think that problem is within esprima itself.