8ed251d0c7
* 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
273 lines
4.3 KiB
Plaintext
273 lines
4.3 KiB
Plaintext
=== tests/cases/conformance/jsx/1.tsx ===
|
|
declare var React: any;
|
|
>React : any
|
|
|
|
</>;
|
|
>> : boolean
|
|
> : any
|
|
> : any
|
|
|
|
=== tests/cases/conformance/jsx/2.tsx ===
|
|
<a: />;
|
|
><a: /> : any
|
|
>a : any
|
|
|
|
=== tests/cases/conformance/jsx/3.tsx ===
|
|
<:a />;
|
|
>< : boolean
|
|
> : any
|
|
> : any
|
|
>a /> : boolean
|
|
>a / : number
|
|
>a : any
|
|
> : any
|
|
> : any
|
|
|
|
=== tests/cases/conformance/jsx/4.tsx ===
|
|
<a b=d />;
|
|
><a b=d /> : any
|
|
>a : any
|
|
>b : true
|
|
>d : true
|
|
|
|
=== tests/cases/conformance/jsx/5.tsx ===
|
|
<a>;
|
|
><a>; : any
|
|
>a : any
|
|
> : any
|
|
|
|
=== tests/cases/conformance/jsx/6.tsx ===
|
|
<a></b>;
|
|
><a></b> : any
|
|
>a : any
|
|
>b : any
|
|
|
|
=== tests/cases/conformance/jsx/7.tsx ===
|
|
<a foo="bar;
|
|
><a foo="bar; : any
|
|
>a : any
|
|
>foo : string
|
|
|
|
=== tests/cases/conformance/jsx/8.tsx ===
|
|
<a:b></b>;
|
|
><a:b></b> : any
|
|
>a:b : any
|
|
>b : any
|
|
|
|
=== tests/cases/conformance/jsx/9.tsx ===
|
|
<a:b.c></a:b.c>;
|
|
><a:b.c></a:b.c> : any
|
|
>a:b.c : any
|
|
>a:b : any
|
|
>c : any
|
|
>a:b.c : any
|
|
>a:b : any
|
|
>c : any
|
|
|
|
=== tests/cases/conformance/jsx/10.tsx ===
|
|
<a.b:c></a.b:c>;
|
|
><a.b:c></a.b : any
|
|
>a.b : any
|
|
>a : any
|
|
>b : any
|
|
>c : true
|
|
>a.b : any
|
|
>a : any
|
|
>b : any
|
|
>c> : boolean
|
|
>c : any
|
|
> : any
|
|
|
|
=== tests/cases/conformance/jsx/11.tsx ===
|
|
<a.b.c></a>;
|
|
><a.b.c></a> : any
|
|
>a.b.c : any
|
|
>a.b : any
|
|
>a : any
|
|
>b : any
|
|
>c : any
|
|
>a : any
|
|
|
|
=== tests/cases/conformance/jsx/12.tsx ===
|
|
<.a></.a>;
|
|
><.a> : boolean
|
|
><.a : boolean
|
|
> : any
|
|
>.a : any
|
|
> : any
|
|
>a : any
|
|
> : any
|
|
>a> : boolean
|
|
>a : any
|
|
> : any
|
|
|
|
=== tests/cases/conformance/jsx/13.tsx ===
|
|
<a.></a.>;
|
|
><a.></a.> : any
|
|
>a. : any
|
|
>a : any
|
|
> : any
|
|
>a. : any
|
|
>a : any
|
|
> : any
|
|
|
|
=== tests/cases/conformance/jsx/14.tsx ===
|
|
<a[foo]></a[foo]>;
|
|
><a : any
|
|
>a : any
|
|
>[foo]> : boolean
|
|
>[foo] : any[]
|
|
>foo : any
|
|
> : any
|
|
>a[foo]> : boolean
|
|
>a[foo] : any
|
|
>a : any
|
|
>foo : any
|
|
> : any
|
|
|
|
=== tests/cases/conformance/jsx/15.tsx ===
|
|
<a['foo']></a['foo']>;
|
|
><a : any
|
|
>a : any
|
|
>['foo']> : boolean
|
|
>['foo'] : string[]
|
|
>'foo' : "foo"
|
|
> : any
|
|
>a['foo']> : boolean
|
|
>a['foo'] : any
|
|
>a : any
|
|
>'foo' : "foo"
|
|
> : any
|
|
|
|
=== tests/cases/conformance/jsx/16.tsx ===
|
|
<a><a />;
|
|
><a><a />; : any
|
|
>a : any
|
|
><a /> : any
|
|
>a : any
|
|
> : any
|
|
|
|
=== tests/cases/conformance/jsx/17.tsx ===
|
|
<a b={}>;
|
|
><a b={}>; : any
|
|
>a : any
|
|
>b : any
|
|
> : any
|
|
|
|
=== tests/cases/conformance/jsx/18.tsx ===
|
|
var x = /* Leading trivia */ <div>one</div><div>two</div>;;
|
|
>x : any
|
|
><div>one</div><div>two</div> : any
|
|
><div>one</div> : any
|
|
>div : any
|
|
>div : any
|
|
><div>two</div> : any
|
|
>div : any
|
|
>div : any
|
|
|
|
=== tests/cases/conformance/jsx/19.tsx ===
|
|
var x = <div>one</div> /* intervening comment */ <div>two</div>;;
|
|
>x : any
|
|
><div>one</div> /* intervening comment */ <div>two</div> : any
|
|
><div>one</div> : any
|
|
>div : any
|
|
>div : any
|
|
><div>two</div> : any
|
|
>div : any
|
|
>div : any
|
|
|
|
=== tests/cases/conformance/jsx/20.tsx ===
|
|
<a>{"str";}</a>;
|
|
><a>{"str";}</a> : any
|
|
>a : any
|
|
>"str" : "str"
|
|
>a : any
|
|
|
|
=== tests/cases/conformance/jsx/21.tsx ===
|
|
<span className="a", id="b" />;
|
|
><span className="a", id="b" /> : any
|
|
>span : any
|
|
>className : string
|
|
>id : string
|
|
|
|
=== tests/cases/conformance/jsx/22.tsx ===
|
|
<div className"app">;
|
|
><div className : any
|
|
>div : any
|
|
>className : true
|
|
>"app"> : boolean
|
|
>"app" : "app"
|
|
> : any
|
|
|
|
=== tests/cases/conformance/jsx/23.tsx ===
|
|
<div {props} />;
|
|
><div {props} /> : any
|
|
>div : any
|
|
>props : any
|
|
|
|
=== tests/cases/conformance/jsx/24.tsx ===
|
|
<div>stuff</div {...props}>;
|
|
><div>stuff</div : any
|
|
>div : any
|
|
>div : any
|
|
>props : any
|
|
>> : boolean
|
|
> : any
|
|
> : any
|
|
|
|
=== tests/cases/conformance/jsx/25.tsx ===
|
|
<div {...props}>stuff</div {...props}>;
|
|
><div {...props}>stuff</div : any
|
|
>div : any
|
|
>props : any
|
|
>div : any
|
|
>props : any
|
|
>> : boolean
|
|
> : any
|
|
> : any
|
|
|
|
|
|
=== tests/cases/conformance/jsx/26.tsx ===
|
|
<a>></a>;
|
|
><a>></a> : any
|
|
>a : any
|
|
>a : any
|
|
|
|
=== tests/cases/conformance/jsx/27.tsx ===
|
|
<a> ></a>;
|
|
><a> ></a> : any
|
|
>a : any
|
|
>a : any
|
|
|
|
=== tests/cases/conformance/jsx/28.tsx ===
|
|
<a b=}>;
|
|
><a b=}>; : any
|
|
>a : any
|
|
>b : true
|
|
|
|
> : any
|
|
|
|
=== tests/cases/conformance/jsx/29.tsx ===
|
|
<a b=<}>;
|
|
><a b=<}>; : any
|
|
><a b= : any
|
|
>a : any
|
|
>b : true
|
|
><}>; : any
|
|
> : any
|
|
|
|
> : any
|
|
|
|
=== tests/cases/conformance/jsx/30.tsx ===
|
|
<a>}</a>;
|
|
><a>}</a> : any
|
|
>a : any
|
|
>a : any
|
|
|
|
=== tests/cases/conformance/jsx/31.tsx ===
|
|
<a .../*hai*/asdf/>;
|
|
><a .../*hai*/asdf/> : any
|
|
>a : any
|
|
>asdf : true
|
|
|