mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-10 15:25:54 -06:00
Allow characters in JsxText inside JsxFragment that would not normally scan
This commit is contained in:
parent
bb2c58b977
commit
71ff6dd91e
@ -4176,8 +4176,9 @@ namespace ts {
|
||||
parseExpected(SyntaxKind.LessThanToken);
|
||||
|
||||
if (token() === SyntaxKind.GreaterThanToken) {
|
||||
parseExpected(SyntaxKind.GreaterThanToken);
|
||||
// See below for explanation of scanJsxText
|
||||
const node: JsxOpeningFragment = <JsxOpeningFragment>createNode(SyntaxKind.JsxOpeningFragment, fullStart);
|
||||
scanJsxText();
|
||||
return finishNode(node);
|
||||
}
|
||||
|
||||
|
||||
@ -12,7 +12,8 @@ declare var React: any;
|
||||
< /*starting wrap*/ ></ /*ending wrap*/>; // comments in the tags
|
||||
<>hi</>; // text inside
|
||||
<><span>hi</span><div>bye</div></>; // children
|
||||
<><span>1</span><><span>2.1</span><span>2.2</span></><span>3</span></>; // nested fragments
|
||||
<><span>1</span><><span>2.1</span><span>2.2</span></><span>3</span></>; // nested fragments
|
||||
<>#</>; // # would cause scanning error if not in jsxtext
|
||||
|
||||
//// [file.jsx]
|
||||
<></>; // no whitespace
|
||||
@ -21,3 +22,4 @@ declare var React: any;
|
||||
<>hi</>; // text inside
|
||||
<><span>hi</span><div>bye</div></>; // children
|
||||
<><span>1</span><><span>2.1</span><span>2.2</span></><span>3</span></>; // nested fragments
|
||||
<>#</>; // # would cause scanning error if not in jsxtext
|
||||
|
||||
@ -35,3 +35,4 @@ declare var React: any;
|
||||
>span : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
|
||||
>span : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
|
||||
|
||||
<>#</>; // # would cause scanning error if not in jsxtext
|
||||
|
||||
@ -52,3 +52,6 @@ declare var React: any;
|
||||
>span : any
|
||||
>span : any
|
||||
|
||||
<>#</>; // # would cause scanning error if not in jsxtext
|
||||
><>#</> : JSX.Element
|
||||
|
||||
|
||||
@ -12,7 +12,8 @@ declare var React: any;
|
||||
< /*starting wrap*/ ></ /*ending wrap*/>; // comments in the tags
|
||||
<>hi</>; // text inside
|
||||
<><span>hi</span><div>bye</div></>; // children
|
||||
<><span>1</span><><span>2.1</span><span>2.2</span></><span>3</span></>; // nested fragments
|
||||
<><span>1</span><><span>2.1</span><span>2.2</span></><span>3</span></>; // nested fragments
|
||||
<>#</>; // # would cause scanning error if not in jsxtext
|
||||
|
||||
//// [file.js]
|
||||
React.createElement(React.Fragment, null); // no whitespace
|
||||
@ -28,3 +29,4 @@ React.createElement(React.Fragment, null,
|
||||
React.createElement("span", null, "2.1"),
|
||||
React.createElement("span", null, "2.2")),
|
||||
React.createElement("span", null, "3")); // nested fragments
|
||||
React.createElement(React.Fragment, null, "#"); // # would cause scanning error if not in jsxtext
|
||||
|
||||
@ -35,3 +35,4 @@ declare var React: any;
|
||||
>span : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
|
||||
>span : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
|
||||
|
||||
<>#</>; // # would cause scanning error if not in jsxtext
|
||||
|
||||
@ -52,3 +52,6 @@ declare var React: any;
|
||||
>span : any
|
||||
>span : any
|
||||
|
||||
<>#</>; // # would cause scanning error if not in jsxtext
|
||||
><>#</> : JSX.Element
|
||||
|
||||
|
||||
@ -14,4 +14,5 @@ declare var React: any;
|
||||
< /*starting wrap*/ ></ /*ending wrap*/>; // comments in the tags
|
||||
<>hi</>; // text inside
|
||||
<><span>hi</span><div>bye</div></>; // children
|
||||
<><span>1</span><><span>2.1</span><span>2.2</span></><span>3</span></>; // nested fragments
|
||||
<><span>1</span><><span>2.1</span><span>2.2</span></><span>3</span></>; // nested fragments
|
||||
<>#</>; // # would cause scanning error if not in jsxtext
|
||||
@ -14,4 +14,5 @@ declare var React: any;
|
||||
< /*starting wrap*/ ></ /*ending wrap*/>; // comments in the tags
|
||||
<>hi</>; // text inside
|
||||
<><span>hi</span><div>bye</div></>; // children
|
||||
<><span>1</span><><span>2.1</span><span>2.2</span></><span>3</span></>; // nested fragments
|
||||
<><span>1</span><><span>2.1</span><span>2.2</span></><span>3</span></>; // nested fragments
|
||||
<>#</>; // # would cause scanning error if not in jsxtext
|
||||
Loading…
x
Reference in New Issue
Block a user