diff --git a/src/parser.ts b/src/parser.ts index 1766d9b..67cace2 100644 --- a/src/parser.ts +++ b/src/parser.ts @@ -9061,7 +9061,7 @@ function parseJSXExpressionContainer( line: number, column: number ): ESTree.JSXExpressionContainer | ESTree.JSXSpreadChild { - nextToken(parser, context); + nextToken(parser, context | Context.AllowRegExp); const { tokenPos, linePos, colPos } = parser; if (parser.token === Token.Ellipsis) return parseJSXSpreadChild(parser, context, tokenPos, linePos, colPos); diff --git a/test/parser/miscellaneous/jsx.ts b/test/parser/miscellaneous/jsx.ts index a782e23..31e02a7 100644 --- a/test/parser/miscellaneous/jsx.ts +++ b/test/parser/miscellaneous/jsx.ts @@ -18,7 +18,9 @@ describe('Miscellaneous - JSX', () => { text ;`, '
{this.props.children}
;', - '{};' + '{};', + '

{1/2}

', + '

{/w/.test(s)}

' ]) { it(`${arg}`, () => { t.doesNotThrow(() => { @@ -105,7 +107,8 @@ describe('Miscellaneous - JSX', () => { ['[foo] > ;', Context.OptionsJSX], ['[foo] > ;', Context.OptionsJSX], ['[foo] > ;', Context.OptionsJSX], - ['var x =
one
,
two
;', Context.OptionsJSX] + ['var x =
one
,
two
;', Context.OptionsJSX], + ['

{/}

', Context.OptionsJSX] ]); pass('Miscellaneous - JSX (pass)', [