capaj / require-globify

transform for browserify, which allows to require files with globbing expressions
MIT License
70 stars 11 forks source link

Does not parse `const` #25

Closed jacwright closed 8 years ago

jacwright commented 8 years ago

The keyword const is now available in many browsers and in node.js. Browserify/watchify parse const just fine, but when adding require-globify to the transforms the error

SyntaxError: Unexpected token...

is thrown for those const keywords.

capaj commented 8 years ago

Just throwing in a callstack: SyntaxError: Unexpected token (1:6) (while require-globify was processing /home/capaj/git_projects/es6-6to5-browserify-boilerplate/src2/a.js) while parsing file: /home/capaj/git_projects/es6-6to5-browserify-boilerplate/src2/a.js at Parser.pp.raise (/home/capaj/git_projects/es6-6to5-browserify-boilerplate/node_modules/acorn/dist/acorn.js:1745:13) at Parser.pp.unexpected (/home/capaj/git_projects/es6-6to5-browserify-boilerplate/node_modules/acorn/dist/acorn.js:2264:8) at Parser.pp.semicolon (/home/capaj/git_projects/es6-6to5-browserify-boilerplate/node_modules/acorn/dist/acorn.js:2243:59) at Parser.pp.parseExpressionStatement (/home/capaj/git_projects/es6-6to5-browserify-boilerplate/node_modules/acorn/dist/acorn.js:2677:8) at Parser.pp.parseStatement (/home/capaj/git_projects/es6-6to5-browserify-boilerplate/node_modules/acorn/dist/acorn.js:2462:160) at Parser.pp.parseTopLevel (/home/capaj/git_projects/es6-6to5-browserify-boilerplate/node_modules/acorn/dist/acorn.js:2379:21) at parse (/home/capaj/git_projects/es6-6to5-browserify-boilerplate/node_modules/acorn/dist/acorn.js:101:12) at module.exports (/home/capaj/git_projects/es6-6to5-browserify-boilerplate/node_modules/falafel/index.js:22:15) at Stream. (/home/capaj/git_projects/es6-6to5-browserify-boilerplate/node_modules/browserify-transform-tools/lib/transformTools.js:187:21) at Stream.end (/home/capaj/git_projects/es6-6to5-browserify-boilerplate/node_modules/browserify-transform-tools/lib/transformTools.js:108:30)

capaj commented 8 years ago

@jacwright should be fixed by that PR, I will let @call-a3 couple of days to merge it, if he's not available, will bump and release it as 1.4.0 myself