File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -602,6 +602,9 @@ module.exports = function(acorn) {
602
602
node . openingElement = openingElement ;
603
603
node . closingElement = closingElement ;
604
604
node . children = children ;
605
+ if ( this . type === tt . relational && this . value === "<" ) {
606
+ this . raise ( this . pos , "Adjacent JSX elements must be wrapped in an enclosing tag" ) ;
607
+ }
605
608
return this . finishNode ( node , 'JSXElement' ) ;
606
609
} ;
607
610
Original file line number Diff line number Diff line change @@ -3633,8 +3633,11 @@ var fbTestFixture = {
3633
3633
3634
3634
if ( typeof exports !== "undefined" ) {
3635
3635
var test = require ( "./driver.js" ) . test ;
3636
+ var testFail = require ( "./driver.js" ) . testFail ;
3636
3637
}
3637
3638
3639
+ testFail ( "var x = <div>one</div><div>two</div>;" , "Adjacent JSX elements must be wrapped in an enclosing tag (1:23)" ) ;
3640
+
3638
3641
for ( var ns in fbTestFixture ) {
3639
3642
ns = fbTestFixture [ ns ] ;
3640
3643
for ( var code in ns ) {
You can’t perform that action at this time.
0 commit comments