Skip to content

Commit 52894cf

Browse files
committed
Accept baselines, I guess
1 parent 2856aab commit 52894cf

10 files changed

+33
-44
lines changed

tests/baselines/reference/jsxAndTypeAssertion.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,21 @@ var foo = /** @class */ (function () {
2828
return foo;
2929
}());
3030
var x;
31-
x = <any> {test} <any></any> };
31+
x = <any> {test}: <any></any> };
3232

3333
x = <any><any></any>;
3434

35-
x = <foo>hello {<foo>} </foo>}
35+
x = <foo>hello {<foo>} </foo>};
3636

3737
x = <foo test={<foo>}>hello</foo>}/>
3838

39-
x = <foo test={<foo>}>hello{<foo>}</foo>}
39+
x = <foo test={<foo>}>hello{<foo>}</foo>};
4040

4141
x = <foo>x</foo>, x = <foo />;
4242

4343
<foo>{<foo><foo>{/foo/.test(x) ? <foo><foo></foo> : <foo><foo></foo>}</foo>}</foo>
4444
:
45-
}</></>}</></>}/></></></>;
45+
}
46+
47+
48+
</></>}</></>}/></></></>;

tests/baselines/reference/jsxInvalidEsprimaTestSuite.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ var x = <div>one</div>, <div>two</div>;
123123
var x = <div>one</div> /* intervening comment */, /* intervening comment */ <div>two</div>;
124124
;
125125
//// [20.jsx]
126-
<a>{"str"}}</a>;
126+
<a>{"str"};}</a>;
127127
//// [21.jsx]
128128
<span className="a" id="b"/>;
129129
//// [22.jsx]
Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
tests/cases/conformance/jsx/file.tsx(11,36): error TS1005: '}' expected.
2-
tests/cases/conformance/jsx/file.tsx(11,44): error TS1003: Identifier expected.
3-
tests/cases/conformance/jsx/file.tsx(11,46): error TS1161: Unterminated regular expression literal.
1+
tests/cases/conformance/jsx/file.tsx(11,30): error TS2695: Left side of comma operator is unused and has no side effects.
2+
tests/cases/conformance/jsx/file.tsx(11,30): error TS18007: JSX expressions may not use the comma operator. Did you mean to write an array?
43

54

6-
==== tests/cases/conformance/jsx/file.tsx (3 errors) ====
5+
==== tests/cases/conformance/jsx/file.tsx (2 errors) ====
76
declare module JSX {
87
interface Element { }
98
interface IntrinsicElements {
@@ -15,10 +14,8 @@ tests/cases/conformance/jsx/file.tsx(11,46): error TS1161: Unterminated regular
1514
const class1 = "foo";
1615
const class2 = "bar";
1716
const elem = <div className={class1, class2}/>;
18-
~
19-
!!! error TS1005: '}' expected.
20-
~
21-
!!! error TS1003: Identifier expected.
22-
23-
!!! error TS1161: Unterminated regular expression literal.
17+
~~~~~~
18+
!!! error TS2695: Left side of comma operator is unused and has no side effects.
19+
~~~~~~~~~~~~~~
20+
!!! error TS18007: JSX expressions may not use the comma operator. Did you mean to write an array?
2421

tests/baselines/reference/jsxParsingError1.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,4 @@ const elem = <div className={class1, class2}/>;
1616
// This should be a parse error
1717
var class1 = "foo";
1818
var class2 = "bar";
19-
var elem = <div className={class1} class2/>;
20-
/>;;
19+
var elem = <div className={class1, class2}/>;

tests/baselines/reference/jsxParsingError1.symbols

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ const elem = <div className={class1, class2}/>;
2525
>div : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22))
2626
>className : Symbol(className, Decl(file.tsx, 10, 17))
2727
>class1 : Symbol(class1, Decl(file.tsx, 8, 5))
28-
>class2 : Symbol(class2, Decl(file.tsx, 10, 36))
28+
>class2 : Symbol(class2, Decl(file.tsx, 9, 5))
2929

tests/baselines/reference/jsxParsingError1.types

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ const class2 = "bar";
1818

1919
const elem = <div className={class1, class2}/>;
2020
>elem : JSX.Element
21-
><div className={class1, class2 : JSX.Element
21+
><div className={class1, class2}/> : JSX.Element
2222
>div : any
2323
>className : string
24+
>class1, class2 : "bar"
2425
>class1 : "foo"
25-
>class2 : true
26-
>/>; : RegExp
26+
>class2 : "bar"
2727

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,14 @@
1-
tests/cases/conformance/jsx/file.tsx(4,11): error TS17008: JSX element 'div' has no corresponding closing tag.
21
tests/cases/conformance/jsx/file.tsx(4,19): error TS1109: Expression expected.
3-
tests/cases/conformance/jsx/file.tsx(7,11): error TS2304: Cannot find name 'a'.
4-
tests/cases/conformance/jsx/file.tsx(7,12): error TS1005: '}' expected.
5-
tests/cases/conformance/jsx/file.tsx(8,1): error TS1005: '</' expected.
62

73

8-
==== tests/cases/conformance/jsx/file.tsx (5 errors) ====
4+
==== tests/cases/conformance/jsx/file.tsx (1 errors) ====
95
declare namespace JSX { interface Element { } }
106

117
function foo() {
128
var x = <div> { </div>
13-
~~~
14-
!!! error TS17008: JSX element 'div' has no corresponding closing tag.
159
~~
1610
!!! error TS1109: Expression expected.
1711
}
1812
// Shouldn't see any errors down here
1913
var y = { a: 1 };
20-
~
21-
!!! error TS2304: Cannot find name 'a'.
22-
~
23-
!!! error TS1005: '}' expected.
24-
25-
26-
!!! error TS1005: '</' expected.
14+

tests/baselines/reference/tsxErrorRecovery1.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ var y = { a: 1 };
1010

1111
//// [file.jsx]
1212
function foo() {
13-
var x = <div> {}div>
14-
}
15-
// Shouldn't see any errors down here
16-
var y = {a} 1 };
17-
</>;
13+
var x = <div> {} </div>;
1814
}
15+
// Shouldn't see any errors down here
16+
var y = { a: 1 };

tests/baselines/reference/tsxErrorRecovery1.symbols

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ function foo() {
1111
}
1212
// Shouldn't see any errors down here
1313
var y = { a: 1 };
14+
>y : Symbol(y, Decl(file.tsx, 6, 3))
15+
>a : Symbol(a, Decl(file.tsx, 6, 9))
1416

tests/baselines/reference/tsxErrorRecovery1.types

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ function foo() {
66

77
var x = <div> { </div>
88
>x : JSX.Element
9-
><div> { </div>}// Shouldn't see any errors down herevar y = { a: 1 }; : JSX.Element
9+
><div> { </div> : JSX.Element
1010
>div : any
1111
> : any
12+
>div : any
1213
}
1314
// Shouldn't see any errors down here
1415
var y = { a: 1 };
15-
>a : any
16-
17-
> : any
16+
>y : { a: number; }
17+
>{ a: 1 } : { a: number; }
18+
>a : number
19+
>1 : 1
1820

0 commit comments

Comments
 (0)