Skip to content

Commit e82e737

Browse files
author
Yui T
committed
Update baselines
1 parent 0cbfc79 commit e82e737

26 files changed

+928
-81
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//// [0.js]
2+
// @ts-check
3+
/**
4+
* @param {number=} n
5+
* @param {string} [s]
6+
*/
7+
function foo(n, s) {}
8+
9+
foo();
10+
foo(1);
11+
foo(1, "hi");
12+
13+
//// [0.js]
14+
// @ts-check
15+
/**
16+
* @param {number=} n
17+
* @param {string} [s]
18+
*/
19+
function foo(n, s) { }
20+
foo();
21+
foo(1);
22+
foo(1, "hi");
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
=== tests/cases/conformance/jsdoc/0.js ===
2+
// @ts-check
3+
/**
4+
* @param {number=} n
5+
* @param {string} [s]
6+
*/
7+
function foo(n, s) {}
8+
>foo : Symbol(foo, Decl(0.js, 0, 0))
9+
>n : Symbol(n, Decl(0.js, 5, 13))
10+
>s : Symbol(s, Decl(0.js, 5, 15))
11+
12+
foo();
13+
>foo : Symbol(foo, Decl(0.js, 0, 0))
14+
15+
foo(1);
16+
>foo : Symbol(foo, Decl(0.js, 0, 0))
17+
18+
foo(1, "hi");
19+
>foo : Symbol(foo, Decl(0.js, 0, 0))
20+
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
=== tests/cases/conformance/jsdoc/0.js ===
2+
// @ts-check
3+
/**
4+
* @param {number=} n
5+
* @param {string} [s]
6+
*/
7+
function foo(n, s) {}
8+
>foo : (n?: number, s?: string) => void
9+
>n : number
10+
>s : string
11+
12+
foo();
13+
>foo() : void
14+
>foo : (n?: number, s?: string) => void
15+
16+
foo(1);
17+
>foo(1) : void
18+
>foo : (n?: number, s?: string) => void
19+
>1 : 1
20+
21+
foo(1, "hi");
22+
>foo(1, "hi") : void
23+
>foo : (n?: number, s?: string) => void
24+
>1 : 1
25+
>"hi" : "hi"
26+
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
//// [returns.js]
2+
// @ts-check
3+
/**
4+
* @returns {string} This comment is not currently exposed
5+
*/
6+
function f() {
7+
return "hello";
8+
}
9+
10+
/**
11+
* @returns {string=} This comment is not currently exposed
12+
*/
13+
function f1() {
14+
return "hello world";
15+
}
16+
17+
/**
18+
* @returns {string|number} This comment is not currently exposed
19+
*/
20+
function f2() {
21+
return 5 || "hello";
22+
}
23+
24+
//// [dummy.js]
25+
// @ts-check
26+
/**
27+
* @returns {string} This comment is not currently exposed
28+
*/
29+
function f() {
30+
return "hello";
31+
}
32+
/**
33+
* @returns {string=} This comment is not currently exposed
34+
*/
35+
function f1() {
36+
return "hello world";
37+
}
38+
/**
39+
* @returns {string|number} This comment is not currently exposed
40+
*/
41+
function f2() {
42+
return 5 || "hello";
43+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
=== tests/cases/conformance/jsdoc/returns.js ===
2+
// @ts-check
3+
/**
4+
* @returns {string} This comment is not currently exposed
5+
*/
6+
function f() {
7+
>f : Symbol(f, Decl(returns.js, 0, 0))
8+
9+
return "hello";
10+
}
11+
12+
/**
13+
* @returns {string=} This comment is not currently exposed
14+
*/
15+
function f1() {
16+
>f1 : Symbol(f1, Decl(returns.js, 6, 1))
17+
18+
return "hello world";
19+
}
20+
21+
/**
22+
* @returns {string|number} This comment is not currently exposed
23+
*/
24+
function f2() {
25+
>f2 : Symbol(f2, Decl(returns.js, 13, 1))
26+
27+
return 5 || "hello";
28+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
=== tests/cases/conformance/jsdoc/returns.js ===
2+
// @ts-check
3+
/**
4+
* @returns {string} This comment is not currently exposed
5+
*/
6+
function f() {
7+
>f : () => string
8+
9+
return "hello";
10+
>"hello" : "hello"
11+
}
12+
13+
/**
14+
* @returns {string=} This comment is not currently exposed
15+
*/
16+
function f1() {
17+
>f1 : () => string
18+
19+
return "hello world";
20+
>"hello world" : "hello world"
21+
}
22+
23+
/**
24+
* @returns {string|number} This comment is not currently exposed
25+
*/
26+
function f2() {
27+
>f2 : () => string | number
28+
29+
return 5 || "hello";
30+
>5 || "hello" : "hello" | 5
31+
>5 : 5
32+
>"hello" : "hello"
33+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//// [returns.js]
2+
// @ts-check
3+
/**
4+
* @returns {string} This comment is not currently exposed
5+
*/
6+
function f() {
7+
return 5;
8+
}
9+
10+
/**
11+
* @returns {string | number} This comment is not currently exposed
12+
*/
13+
function f1() {
14+
return 5 || true;
15+
}
16+
17+
//// [dummy.js]
18+
// @ts-check
19+
/**
20+
* @returns {string} This comment is not currently exposed
21+
*/
22+
function f() {
23+
return 5;
24+
}
25+
/**
26+
* @returns {string | number} This comment is not currently exposed
27+
*/
28+
function f1() {
29+
return 5 || true;
30+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
=== tests/cases/conformance/jsdoc/returns.js ===
2+
// @ts-check
3+
/**
4+
* @returns {string} This comment is not currently exposed
5+
*/
6+
function f() {
7+
>f : Symbol(f, Decl(returns.js, 0, 0))
8+
9+
return 5;
10+
}
11+
12+
/**
13+
* @returns {string | number} This comment is not currently exposed
14+
*/
15+
function f1() {
16+
>f1 : Symbol(f1, Decl(returns.js, 6, 1))
17+
18+
return 5 || true;
19+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
=== tests/cases/conformance/jsdoc/returns.js ===
2+
// @ts-check
3+
/**
4+
* @returns {string} This comment is not currently exposed
5+
*/
6+
function f() {
7+
>f : () => string
8+
9+
return 5;
10+
>5 : 5
11+
}
12+
13+
/**
14+
* @returns {string | number} This comment is not currently exposed
15+
*/
16+
function f1() {
17+
>f1 : () => string | number
18+
19+
return 5 || true;
20+
>5 || true : true | 5
21+
>5 : 5
22+
>true : true
23+
}

tests/baselines/reference/jsDocTypes2.js renamed to tests/baselines/reference/checkJsdocTypeTag1.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
//// [0.js]
22
// @ts-check
3+
/** @type {String} */
4+
var S = "hello world";
5+
6+
/** @type {number} */
7+
var n = 10;
8+
39
/** @type {*} */
410
var anyT = 2;
11+
anyT = "hello";
512

613
/** @type {?} */
714
var anyT1 = 2;
@@ -21,8 +28,13 @@ x2(0);
2128

2229
//// [0.js]
2330
// @ts-check
31+
/** @type {String} */
32+
var S = "hello world";
33+
/** @type {number} */
34+
var n = 10;
2435
/** @type {*} */
2536
var anyT = 2;
37+
anyT = "hello";
2638
/** @type {?} */
2739
var anyT1 = 2;
2840
anyT1 = "hi";

0 commit comments

Comments
 (0)