Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add case from daniel
  • Loading branch information
jakebailey committed Jun 17, 2022
commit e76fe4c669b7d9a1d041c9f191d801b805ad9d23
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js(1,1): error TS2304: Cannot find name 'a'.
tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js(1,5): error TS2304: Cannot find name 'b'.
tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js(1,15): error TS2304: Cannot find name 'd'.
tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js(1,15): error TS8010: Type annotations can only be used in TypeScript files.
tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js(1,20): error TS2304: Cannot find name 'e'.
tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileTs.ts(1,1): error TS2304: Cannot find name 'a'.
tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileTs.ts(1,5): error TS2304: Cannot find name 'b'.
tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileTs.ts(1,15): error TS2304: Cannot find name 'd'.
tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileTs.ts(1,20): error TS2304: Cannot find name 'e'.


==== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js (5 errors) ====
a ? b : (c) : d => e // Not legal JS; "Unexpected token ':'" at last colon
~
!!! error TS2304: Cannot find name 'a'.
~
!!! error TS2304: Cannot find name 'b'.
~
!!! error TS2304: Cannot find name 'd'.
~
!!! error TS8010: Type annotations can only be used in TypeScript files.
~
!!! error TS2304: Cannot find name 'e'.

==== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileTs.ts (4 errors) ====
a ? b : (c) : d => e
~
!!! error TS2304: Cannot find name 'a'.
~
!!! error TS2304: Cannot find name 'b'.
~
!!! error TS2304: Cannot find name 'd'.
~
!!! error TS2304: Cannot find name 'e'.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//// [tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression17.ts] ////

//// [fileJs.js]
a ? b : (c) : d => e // Not legal JS; "Unexpected token ':'" at last colon

//// [fileTs.ts]
a ? b : (c) : d => e


//// [fileJs.js]
a ? b : function (c) { return e; }; // Not legal JS; "Unexpected token ':'" at last colon
//// [fileTs.js]
a ? b : function (c) { return e; };
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
=== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js ===
a ? b : (c) : d => e // Not legal JS; "Unexpected token ':'" at last colon
>c : Symbol(c, Decl(fileJs.js, 0, 9))
>d : Symbol(d)

=== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileTs.ts ===
a ? b : (c) : d => e
>c : Symbol(c, Decl(fileTs.ts, 0, 9))
>d : Symbol(d)

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
=== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js ===
a ? b : (c) : d => e // Not legal JS; "Unexpected token ':'" at last colon
>a ? b : (c) : d => e : any
>a : any
>b : any
>(c) : d => e : (c: any) => d
>c : any
>e : any

=== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileTs.ts ===
a ? b : (c) : d => e
>a ? b : (c) : d => e : any
>a : any
>b : any
>(c) : d => e : (c: any) => d
>c : any
>e : any

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js(1,1): error TS2304: Cannot find name 'a'.
tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js(1,5): error TS2304: Cannot find name 'b'.
tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js(1,15): error TS2304: Cannot find name 'd'.
tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js(1,15): error TS8010: Type annotations can only be used in TypeScript files.
tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js(1,20): error TS2304: Cannot find name 'e'.
tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileTs.ts(1,1): error TS2304: Cannot find name 'a'.
tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileTs.ts(1,5): error TS2304: Cannot find name 'b'.
tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileTs.ts(1,15): error TS2304: Cannot find name 'd'.
tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileTs.ts(1,20): error TS2304: Cannot find name 'e'.


==== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js (5 errors) ====
a ? b : (c) : d => e // Not legal JS; "Unexpected token ':'" at last colon
~
!!! error TS2304: Cannot find name 'a'.
~
!!! error TS2304: Cannot find name 'b'.
~
!!! error TS2304: Cannot find name 'd'.
~
!!! error TS8010: Type annotations can only be used in TypeScript files.
~
!!! error TS2304: Cannot find name 'e'.

==== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileTs.ts (4 errors) ====
a ? b : (c) : d => e
~
!!! error TS2304: Cannot find name 'a'.
~
!!! error TS2304: Cannot find name 'b'.
~
!!! error TS2304: Cannot find name 'd'.
~
!!! error TS2304: Cannot find name 'e'.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//// [tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression17.ts] ////

//// [fileJs.js]
a ? b : (c) : d => e // Not legal JS; "Unexpected token ':'" at last colon

//// [fileTs.ts]
a ? b : (c) : d => e


//// [fileJs.js]
a ? b : (c) => e; // Not legal JS; "Unexpected token ':'" at last colon
//// [fileTs.js]
a ? b : (c) => e;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
=== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js ===
a ? b : (c) : d => e // Not legal JS; "Unexpected token ':'" at last colon
>c : Symbol(c, Decl(fileJs.js, 0, 9))
>d : Symbol(d)

=== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileTs.ts ===
a ? b : (c) : d => e
>c : Symbol(c, Decl(fileTs.ts, 0, 9))
>d : Symbol(d)

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
=== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileJs.js ===
a ? b : (c) : d => e // Not legal JS; "Unexpected token ':'" at last colon
>a ? b : (c) : d => e : any
>a : any
>b : any
>(c) : d => e : (c: any) => d
>c : any
>e : any

=== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/fileTs.ts ===
a ? b : (c) : d => e
>a ? b : (c) : d => e : any
>a : any
>b : any
>(c) : d => e : (c: any) => d
>c : any
>e : any

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// @allowjs: true
// @checkjs: true
// @outdir: out
// @target: es3,es6

// @filename: fileJs.js
a ? b : (c) : d => e // Not legal JS; "Unexpected token ':'" at last colon

// @filename: fileTs.ts
a ? b : (c) : d => e