Skip to content

Commit cc20bb1

Browse files
committed
Baseline and harness changes
1 parent b73558d commit cc20bb1

File tree

1,278 files changed

+10930
-40149
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,278 files changed

+10930
-40149
lines changed

src/harness/compilerRunner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ class CompilerBaselineRunner extends RunnerBase {
307307
allFiles.forEach(file => {
308308
var codeLines = file.content.split('\n');
309309
walker.getTypes(file.unitName).forEach(result => {
310-
var formattedLine = result.identifierName + " : " + result.type;
310+
var formattedLine = result.identifierName.replace(/\r?\n/g, "") + " : " + result.type;
311311
if (!typeMap[file.unitName]) {
312312
typeMap[file.unitName] = {};
313313
}

src/harness/typeWriter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class TypeWriterWalker {
2828
// TODO: Ideally we should log all expressions, but to compare to the
2929
// old typeWriter baselines, suppress tokens
3030
case ts.SyntaxKind.ThisKeyword:
31-
case ts.SyntaxKind.RegularExpressionLiteral:
31+
// case ts.SyntaxKind.RegularExpressionLiteral:
3232
case ts.SyntaxKind.ArrayLiteral:
3333
case ts.SyntaxKind.ObjectLiteral:
3434
case ts.SyntaxKind.PropertyAccess:
@@ -87,7 +87,7 @@ class TypeWriterWalker {
8787
column: lineAndCharacter.character,
8888
syntaxKind: ts.SyntaxKind[node.kind],
8989
identifierName: sourceText,
90-
type: isUnknownType ? sourceText : this.checker.typeToString(type)
90+
type: isUnknownType ? sourceText : this.checker.typeToString(type, undefined, ts.TypeFormatFlags.UseTypeOfFunction)
9191
});
9292
}
9393

tests/baselines/reference/parserX_ArrowFunction1.errors.txt renamed to tests/baselines/reference/ArrowFunction1.errors.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/parserX_ArrowFunction1.ts (1 errors) ====
1+
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction1.ts (1 errors) ====
22
var v = (a: ) => {
33
~
44
!!! Type expected.

tests/baselines/reference/parserX_ArrowFunction2.errors.txt renamed to tests/baselines/reference/ArrowFunction2.errors.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/parserX_ArrowFunction2.ts (2 errors) ====
1+
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction2.ts (2 errors) ====
22
var v = (a: b,) => {
33
~
44
!!! Trailing comma not allowed.

tests/baselines/reference/parserX_ArrowFunction3.errors.txt renamed to tests/baselines/reference/ArrowFunction3.errors.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/parserX_ArrowFunction3.ts (3 errors) ====
1+
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction3.ts (3 errors) ====
22
var v = (a): => {
33
~
44
!!! ',' expected.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
//// [ArrowFunction4.ts]
2+
var v = (a, b) => {
3+
4+
};
5+
6+
//// [ArrowFunction4.js]
7+
var v = function (a, b) {
8+
};

tests/baselines/reference/parserX_ArrowFunction4.types renamed to tests/baselines/reference/ArrowFunction4.types

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
=== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/parserX_ArrowFunction4.ts ===
1+
=== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction4.ts ===
22
var v = (a, b) => {
33
>v : (a: any, b: any) => void
4-
>(a, b) => {
5-
6-
} : (a: any, b: any) => void
4+
>(a, b) => { } : (a: any, b: any) => void
75
>a : any
86
>b : any
97

tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.types

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class Point {
77
>y : number
88

99
static Origin(): Point { return { x: 0, y: 0 }; }
10-
>Origin : () => Point
10+
>Origin : typeof Origin
1111
>Point : Point
1212
>{ x: 0, y: 0 } : { x: number; y: number; }
1313
>x : number
@@ -18,7 +18,7 @@ module Point {
1818
>Point : typeof Point
1919

2020
function Origin() { return ""; }// not an error, since not exported
21-
>Origin : () => string
21+
>Origin : typeof Origin
2222
}
2323

2424

@@ -33,7 +33,7 @@ module A {
3333
>y : number
3434

3535
static Origin(): Point { return { x: 0, y: 0 }; }
36-
>Origin : () => Point
36+
>Origin : typeof Origin
3737
>Point : Point
3838
>{ x: 0, y: 0 } : { x: number; y: number; }
3939
>x : number
@@ -44,6 +44,6 @@ module A {
4444
>Point : typeof Point
4545

4646
function Origin() { return ""; }// not an error since not exported
47-
>Origin : () => string
47+
>Origin : typeof Origin
4848
}
4949
}

tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.types

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ module A {
4747
>TPoint : TPoint
4848

4949
static fromorigin2d(p: Point): Line<Point>{
50-
>fromorigin2d : (p: Point) => Line<Point>
50+
>fromorigin2d : typeof fromorigin2d
5151
>p : Point
5252
>Point : Point
5353
>Line : Line<TPoint>

tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.types

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module A {
2323
}
2424

2525
export function fromOrigin(p: Point): Line {
26-
>fromOrigin : (p: Point) => Line
26+
>fromOrigin : typeof fromOrigin
2727
>p : Point
2828
>Point : Point
2929
>Line : Line

0 commit comments

Comments
 (0)