From c01f0c0b9fa17324281f906242d8d513db7ef25b Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Fri, 17 Nov 2017 10:40:16 -0800 Subject: [PATCH] Test:ts-ignore works on jsdoc syntax errors --- .../reference/syntaxErrors.errors.txt | 6 +++-- .../baselines/reference/syntaxErrors.symbols | 22 +++++++++++-------- tests/baselines/reference/syntaxErrors.types | 16 +++++++++----- tests/cases/conformance/jsdoc/syntaxErrors.ts | 6 +++-- 4 files changed, 32 insertions(+), 18 deletions(-) diff --git a/tests/baselines/reference/syntaxErrors.errors.txt b/tests/baselines/reference/syntaxErrors.errors.txt index 02ad52a15e5..25276af3956 100644 --- a/tests/baselines/reference/syntaxErrors.errors.txt +++ b/tests/baselines/reference/syntaxErrors.errors.txt @@ -12,8 +12,10 @@ tests/cases/conformance/jsdoc/badTypeArguments.js(2,22): error TS1009: Trailing /** @param {C.} y */ ~ !!! error TS1009: Trailing comma not allowed. - function f(x, y) { + // @ts-ignore + /** @param {C.} skipped */ + function f(x, y, skipped) { return x.t + y.t; } - var x = f({ t: 1000 }, { t: 3000 }); + var x = f({ t: 1000 }, { t: 3000 }, { t: 5000 }); \ No newline at end of file diff --git a/tests/baselines/reference/syntaxErrors.symbols b/tests/baselines/reference/syntaxErrors.symbols index a164800875d..2062b13c0b9 100644 --- a/tests/baselines/reference/syntaxErrors.symbols +++ b/tests/baselines/reference/syntaxErrors.symbols @@ -8,22 +8,26 @@ declare class C { t: T } === tests/cases/conformance/jsdoc/badTypeArguments.js === /** @param {C.<>} x */ /** @param {C.} y */ -function f(x, y) { +// @ts-ignore +/** @param {C.} skipped */ +function f(x, y, skipped) { >f : Symbol(f, Decl(badTypeArguments.js, 0, 0)) ->x : Symbol(x, Decl(badTypeArguments.js, 2, 11)) ->y : Symbol(y, Decl(badTypeArguments.js, 2, 13)) +>x : Symbol(x, Decl(badTypeArguments.js, 4, 11)) +>y : Symbol(y, Decl(badTypeArguments.js, 4, 13)) +>skipped : Symbol(skipped, Decl(badTypeArguments.js, 4, 16)) return x.t + y.t; >x.t : Symbol(C.t, Decl(dummyType.d.ts, 0, 20)) ->x : Symbol(x, Decl(badTypeArguments.js, 2, 11)) +>x : Symbol(x, Decl(badTypeArguments.js, 4, 11)) >t : Symbol(C.t, Decl(dummyType.d.ts, 0, 20)) >y.t : Symbol(C.t, Decl(dummyType.d.ts, 0, 20)) ->y : Symbol(y, Decl(badTypeArguments.js, 2, 13)) +>y : Symbol(y, Decl(badTypeArguments.js, 4, 13)) >t : Symbol(C.t, Decl(dummyType.d.ts, 0, 20)) } -var x = f({ t: 1000 }, { t: 3000 }); ->x : Symbol(x, Decl(badTypeArguments.js, 5, 3)) +var x = f({ t: 1000 }, { t: 3000 }, { t: 5000 }); +>x : Symbol(x, Decl(badTypeArguments.js, 7, 3)) >f : Symbol(f, Decl(badTypeArguments.js, 0, 0)) ->t : Symbol(t, Decl(badTypeArguments.js, 5, 11)) ->t : Symbol(t, Decl(badTypeArguments.js, 5, 24)) +>t : Symbol(t, Decl(badTypeArguments.js, 7, 11)) +>t : Symbol(t, Decl(badTypeArguments.js, 7, 24)) +>t : Symbol(t, Decl(badTypeArguments.js, 7, 37)) diff --git a/tests/baselines/reference/syntaxErrors.types b/tests/baselines/reference/syntaxErrors.types index e99e3b9b88e..b52170eee8f 100644 --- a/tests/baselines/reference/syntaxErrors.types +++ b/tests/baselines/reference/syntaxErrors.types @@ -8,10 +8,13 @@ declare class C { t: T } === tests/cases/conformance/jsdoc/badTypeArguments.js === /** @param {C.<>} x */ /** @param {C.} y */ -function f(x, y) { ->f : (x: C, y: C) => any +// @ts-ignore +/** @param {C.} skipped */ +function f(x, y, skipped) { +>f : (x: C, y: C, skipped: C) => any >x : C >y : C +>skipped : C return x.t + y.t; >x.t + y.t : any @@ -22,14 +25,17 @@ function f(x, y) { >y : C >t : number } -var x = f({ t: 1000 }, { t: 3000 }); +var x = f({ t: 1000 }, { t: 3000 }, { t: 5000 }); >x : any ->f({ t: 1000 }, { t: 3000 }) : any ->f : (x: C, y: C) => any +>f({ t: 1000 }, { t: 3000 }, { t: 5000 }) : any +>f : (x: C, y: C, skipped: C) => any >{ t: 1000 } : { t: number; } >t : number >1000 : 1000 >{ t: 3000 } : { t: number; } >t : number >3000 : 3000 +>{ t: 5000 } : { t: number; } +>t : number +>5000 : 5000 diff --git a/tests/cases/conformance/jsdoc/syntaxErrors.ts b/tests/cases/conformance/jsdoc/syntaxErrors.ts index 847a99a5a12..e8a3641cde2 100644 --- a/tests/cases/conformance/jsdoc/syntaxErrors.ts +++ b/tests/cases/conformance/jsdoc/syntaxErrors.ts @@ -8,7 +8,9 @@ declare class C { t: T } // @Filename: badTypeArguments.js /** @param {C.<>} x */ /** @param {C.} y */ -function f(x, y) { +// @ts-ignore +/** @param {C.} skipped */ +function f(x, y, skipped) { return x.t + y.t; } -var x = f({ t: 1000 }, { t: 3000 }); +var x = f({ t: 1000 }, { t: 3000 }, { t: 5000 });