Skip to content

Commit c01f0c0

Browse files
committed
Test:ts-ignore works on jsdoc syntax errors
1 parent eeeefcc commit c01f0c0

4 files changed

Lines changed: 32 additions & 18 deletions

File tree

tests/baselines/reference/syntaxErrors.errors.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ tests/cases/conformance/jsdoc/badTypeArguments.js(2,22): error TS1009: Trailing
1212
/** @param {C.<number,>} y */
1313
~
1414
!!! error TS1009: Trailing comma not allowed.
15-
function f(x, y) {
15+
// @ts-ignore
16+
/** @param {C.<number,>} skipped */
17+
function f(x, y, skipped) {
1618
return x.t + y.t;
1719
}
18-
var x = f({ t: 1000 }, { t: 3000 });
20+
var x = f({ t: 1000 }, { t: 3000 }, { t: 5000 });
1921

tests/baselines/reference/syntaxErrors.symbols

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,26 @@ declare class C<T> { t: T }
88
=== tests/cases/conformance/jsdoc/badTypeArguments.js ===
99
/** @param {C.<>} x */
1010
/** @param {C.<number,>} y */
11-
function f(x, y) {
11+
// @ts-ignore
12+
/** @param {C.<number,>} skipped */
13+
function f(x, y, skipped) {
1214
>f : Symbol(f, Decl(badTypeArguments.js, 0, 0))
13-
>x : Symbol(x, Decl(badTypeArguments.js, 2, 11))
14-
>y : Symbol(y, Decl(badTypeArguments.js, 2, 13))
15+
>x : Symbol(x, Decl(badTypeArguments.js, 4, 11))
16+
>y : Symbol(y, Decl(badTypeArguments.js, 4, 13))
17+
>skipped : Symbol(skipped, Decl(badTypeArguments.js, 4, 16))
1518

1619
return x.t + y.t;
1720
>x.t : Symbol(C.t, Decl(dummyType.d.ts, 0, 20))
18-
>x : Symbol(x, Decl(badTypeArguments.js, 2, 11))
21+
>x : Symbol(x, Decl(badTypeArguments.js, 4, 11))
1922
>t : Symbol(C.t, Decl(dummyType.d.ts, 0, 20))
2023
>y.t : Symbol(C.t, Decl(dummyType.d.ts, 0, 20))
21-
>y : Symbol(y, Decl(badTypeArguments.js, 2, 13))
24+
>y : Symbol(y, Decl(badTypeArguments.js, 4, 13))
2225
>t : Symbol(C.t, Decl(dummyType.d.ts, 0, 20))
2326
}
24-
var x = f({ t: 1000 }, { t: 3000 });
25-
>x : Symbol(x, Decl(badTypeArguments.js, 5, 3))
27+
var x = f({ t: 1000 }, { t: 3000 }, { t: 5000 });
28+
>x : Symbol(x, Decl(badTypeArguments.js, 7, 3))
2629
>f : Symbol(f, Decl(badTypeArguments.js, 0, 0))
27-
>t : Symbol(t, Decl(badTypeArguments.js, 5, 11))
28-
>t : Symbol(t, Decl(badTypeArguments.js, 5, 24))
30+
>t : Symbol(t, Decl(badTypeArguments.js, 7, 11))
31+
>t : Symbol(t, Decl(badTypeArguments.js, 7, 24))
32+
>t : Symbol(t, Decl(badTypeArguments.js, 7, 37))
2933

tests/baselines/reference/syntaxErrors.types

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ declare class C<T> { t: T }
88
=== tests/cases/conformance/jsdoc/badTypeArguments.js ===
99
/** @param {C.<>} x */
1010
/** @param {C.<number,>} y */
11-
function f(x, y) {
12-
>f : (x: C<any>, y: C<number>) => any
11+
// @ts-ignore
12+
/** @param {C.<number,>} skipped */
13+
function f(x, y, skipped) {
14+
>f : (x: C<any>, y: C<number>, skipped: C<number>) => any
1315
>x : C<any>
1416
>y : C<number>
17+
>skipped : C<number>
1518

1619
return x.t + y.t;
1720
>x.t + y.t : any
@@ -22,14 +25,17 @@ function f(x, y) {
2225
>y : C<number>
2326
>t : number
2427
}
25-
var x = f({ t: 1000 }, { t: 3000 });
28+
var x = f({ t: 1000 }, { t: 3000 }, { t: 5000 });
2629
>x : any
27-
>f({ t: 1000 }, { t: 3000 }) : any
28-
>f : (x: C<any>, y: C<number>) => any
30+
>f({ t: 1000 }, { t: 3000 }, { t: 5000 }) : any
31+
>f : (x: C<any>, y: C<number>, skipped: C<number>) => any
2932
>{ t: 1000 } : { t: number; }
3033
>t : number
3134
>1000 : 1000
3235
>{ t: 3000 } : { t: number; }
3336
>t : number
3437
>3000 : 3000
38+
>{ t: 5000 } : { t: number; }
39+
>t : number
40+
>5000 : 5000
3541

tests/cases/conformance/jsdoc/syntaxErrors.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ declare class C<T> { t: T }
88
// @Filename: badTypeArguments.js
99
/** @param {C.<>} x */
1010
/** @param {C.<number,>} y */
11-
function f(x, y) {
11+
// @ts-ignore
12+
/** @param {C.<number,>} skipped */
13+
function f(x, y, skipped) {
1214
return x.t + y.t;
1315
}
14-
var x = f({ t: 1000 }, { t: 3000 });
16+
var x = f({ t: 1000 }, { t: 3000 }, { t: 5000 });

0 commit comments

Comments
 (0)