Skip to content

Commit 31d8cbe

Browse files
Accepted baselines.
1 parent dc1fbc2 commit 31d8cbe

File tree

4 files changed

+51
-1
lines changed

4 files changed

+51
-1
lines changed

tests/baselines/reference/noImplicitThisFunctions.errors.txt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
tests/cases/compiler/noImplicitThisFunctions.ts(13,12): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation.
22
tests/cases/compiler/noImplicitThisFunctions.ts(17,38): error TS7041: The containing arrow function captures the global value of 'this' which implicitly has type 'any'.
3+
tests/cases/compiler/noImplicitThisFunctions.ts(18,22): error TS7041: The containing arrow function captures the global value of 'this' which implicitly has type 'any'.
4+
tests/cases/compiler/noImplicitThisFunctions.ts(20,36): error TS7041: The containing arrow function captures the global value of 'this' which implicitly has type 'any'.
5+
tests/cases/compiler/noImplicitThisFunctions.ts(21,50): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation.
36

47

5-
==== tests/cases/compiler/noImplicitThisFunctions.ts (2 errors) ====
8+
==== tests/cases/compiler/noImplicitThisFunctions.ts (5 errors) ====
69
function f1(x) {
710
// implicit any is still allowed
811
return x + 1;
@@ -24,4 +27,14 @@ tests/cases/compiler/noImplicitThisFunctions.ts(17,38): error TS7041: The contai
2427
let f4: (b: number) => number = b => this.c + b;
2528
~~~~
2629
!!! error TS7041: The containing arrow function captures the global value of 'this' which implicitly has type 'any'.
30+
let f5 = () => () => this;
31+
~~~~
32+
!!! error TS7041: The containing arrow function captures the global value of 'this' which implicitly has type 'any'.
33+
34+
let f6 = function() { return () => this; };
35+
~~~~
36+
!!! error TS7041: The containing arrow function captures the global value of 'this' which implicitly has type 'any'.
37+
let f7 = function() { return function() { return this } };
38+
~~~~
39+
!!! error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation.
2740

tests/baselines/reference/noImplicitThisFunctions.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ function f3(z: number): number {
1616

1717
// error: `this` is `window`, but is still of type `any`
1818
let f4: (b: number) => number = b => this.c + b;
19+
let f5 = () => () => this;
20+
21+
let f6 = function() { return () => this; };
22+
let f7 = function() { return function() { return this } };
1923

2024

2125
//// [noImplicitThisFunctions.js]
@@ -34,3 +38,9 @@ function f3(z) {
3438
}
3539
// error: `this` is `window`, but is still of type `any`
3640
var f4 = function (b) { return _this.c + b; };
41+
var f5 = function () { return function () { return _this; }; };
42+
var f6 = function () {
43+
var _this = this;
44+
return function () { return _this; };
45+
};
46+
var f7 = function () { return function () { return this; }; };

tests/baselines/reference/noImplicitThisFunctions.symbols

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,12 @@ let f4: (b: number) => number = b => this.c + b;
3333
>b : Symbol(b, Decl(noImplicitThisFunctions.ts, 16, 31))
3434
>b : Symbol(b, Decl(noImplicitThisFunctions.ts, 16, 31))
3535

36+
let f5 = () => () => this;
37+
>f5 : Symbol(f5, Decl(noImplicitThisFunctions.ts, 17, 3))
38+
39+
let f6 = function() { return () => this; };
40+
>f6 : Symbol(f6, Decl(noImplicitThisFunctions.ts, 19, 3))
41+
42+
let f7 = function() { return function() { return this } };
43+
>f7 : Symbol(f7, Decl(noImplicitThisFunctions.ts, 20, 3))
44+

tests/baselines/reference/noImplicitThisFunctions.types

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,21 @@ let f4: (b: number) => number = b => this.c + b;
4646
>c : any
4747
>b : number
4848

49+
let f5 = () => () => this;
50+
>f5 : () => () => any
51+
>() => () => this : () => () => any
52+
>() => this : () => any
53+
>this : any
54+
55+
let f6 = function() { return () => this; };
56+
>f6 : () => () => any
57+
>function() { return () => this; } : () => () => any
58+
>() => this : () => any
59+
>this : any
60+
61+
let f7 = function() { return function() { return this } };
62+
>f7 : () => () => any
63+
>function() { return function() { return this } } : () => () => any
64+
>function() { return this } : () => any
65+
>this : any
66+

0 commit comments

Comments
 (0)