Invalid javascript generated for empty code blocks within jsx
Notice the invalid javascript for { /* nada */ }
with buble:
$ echo 'var a = (<Foo>{ /*nada*/ }<Bar>{b}</Bar></Foo>);' | bin/buble
var a = (React.createElement( Foo, null, /*nada*/ , React.createElement( Bar, null, b ) ));
babel generates this code for the empty code block:
$ echo 'var a = (<Foo>{ /*nada*/ }<Bar>{b}</Bar></Foo>);' | babel
"use strict";
var a = React.createElement(
Foo,
null,
/*nada*/React.createElement(
Bar,
null,
b
)
);
The same is true for an empty code block in buble:
$ echo 'var a = (<Foo>{}</Foo>);' | bin/buble
var a = (React.createElement( Foo, null, ));
compared to babel:
$ echo 'var a = (<Foo>{}</Foo>);' | babel
"use strict";
var a = React.createElement(Foo, null);
or // comments
in multi line blocks (not shown).