* Support xml namespace prefix for JSX elements and attributes Just as with the `-` character, `:` is now also treated specially in JSX element and attribute names, but is only allowed a single time, and not at the beginning or end of the name, as is specified in the JSX spec. All tests in jsxInvalidEsprimaTestSuite still fail, but for slightly different reasons now. Two lines in jsxEsprimaFbTestSuite were uncommented as they included elements with namespaces, and they now pass without error. * Add case for colons at ends of identifier * Add case for jsx namepsace intrinsics * Add cases with upcase idents for jsx namespaces * Add case for jsx namespaces with react option * Always consider jsx names with colon to be intrinsics * Adjust comment about chars valid in jsx names but not js idents * Fix minor typo in namespace prefix test case variable name * Remove misleading comments on isUnhyphenatedJsxName
56 lines
826 B
TypeScript
56 lines
826 B
TypeScript
// @jsx: preserve
|
|
declare var React: any;
|
|
declare var 日本語;
|
|
declare var AbC_def;
|
|
declare var LeftRight;
|
|
declare var x;
|
|
declare var a;
|
|
declare var props;
|
|
declare var value;
|
|
|
|
<a />;
|
|
|
|
<n:a n:v />;
|
|
|
|
<a n:foo="bar"> {value} <b><c /></b></a>;
|
|
|
|
<a b={" "} c=" " d="&" e="id=1&group=2" f="�" g="{*;" h="&#x;" />;
|
|
|
|
<a b="¬anentity;" />;
|
|
<a
|
|
/>;
|
|
|
|
<日本語></日本語>;
|
|
|
|
<AbC_def
|
|
test="&&">
|
|
bar
|
|
baz
|
|
</AbC_def>;
|
|
|
|
<a b={x ? <c /> : <d />} />;
|
|
|
|
<a>{}</a>;
|
|
|
|
<a>{/* this is a comment */}</a>;
|
|
|
|
<div>@test content</div>;
|
|
|
|
<div><br />7x invalid-js-identifier</div>;
|
|
|
|
<LeftRight left=<a /> right=<b>monkeys /> gorillas</b> />;
|
|
|
|
<a.b></a.b>;
|
|
|
|
<a.b.c></a.b.c>;
|
|
|
|
(<div />) < x;
|
|
|
|
<div {...props} />;
|
|
|
|
<div {...props} post="attribute" />;
|
|
|
|
<div pre="leading" pre2="attribute" {...props}></div>;
|
|
|
|
<a> </a>;
|