Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing error (Unexpected string) on ['if'] #698

Closed
bpierre opened this issue Mar 13, 2014 · 5 comments
Closed

Parsing error (Unexpected string) on ['if'] #698

bpierre opened this issue Mar 13, 2014 · 5 comments

Comments

@bpierre
Copy link

bpierre commented Mar 13, 2014

// parsing-error.js
var a = require('./dep');
var b = ['if'];
$ browserify parsing-error.js
Error: Parsing file /Users/pierre/src/temp/browserify-bug.js: Line 2: Unexpected string

It works fine if the first declaration is removed.

Bug discovered here: yyx990803/vue@3df6343#commitcomment-5670153

@andreypopp
Copy link
Contributor

Seems like a bug in esprima-six.

@bpierre
Copy link
Author

bpierre commented Mar 13, 2014

And esprima-six has just been replaced by esprima. calvinmetcalf/derequire@af7baac

@andreypopp
Copy link
Contributor

@bpierre yeah, I think this can be replaced by esprima-fb which can parse es6 (Facebook uses it for their es6 to es5 transforms).

@andreypopp
Copy link
Contributor

Just checked it and it works with esprima-fb

bpierre referenced this issue in calvinmetcalf/derequire Mar 13, 2014
The former still has a lot of issues parsing, and will break
on bundling modules such as `escodegen`.

Downgrading to esprima fixes this issue, at the expense of
ES6 support. The same has been done for the following modules:

* astw (http://git.io/3qnK6A)
* detective (http://git.io/GeWevg)
* syntax-error (http://git.io/j7gJZg)
@ghost
Copy link

ghost commented Mar 18, 2014

all the dependent modules I am maintainer of now use esprima-fb in 3.33.0

@ghost ghost closed this as completed Mar 18, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants