babel / babel-brunch

Brunch plugin for Babel
ISC License
68 stars 38 forks source link

Uncaught SyntaxError: Unexpected end of input #10

Closed endel closed 9 years ago

endel commented 9 years ago

When you have a JavaScript block without implementation, just with comments, the "unexpected end of input" errors starts to appear.

if (true) {
  // this comment breaks everything
}

It happens for any statement, even a function:

var test = function() {
  // same thing
}

Screenshot:

screen shot 2015-04-24 at 4 32 20 pm

endel commented 9 years ago

Here is the problem in a diff, one is the output using the plugin and the other is not.

$ diff js_working/app.js js/app.js

93a94,95
> "use strict";
>
96,98c98
< var test = function() {
<   // same thing
< }
---
> var test = function test() {};
100c100
< });
---
> // same thing});
es128 commented 9 years ago

Should be fixed in 5.0.1