Skip to content

Commit aace2c3

Browse files
author
Kanchalai Tanglertsampan
committed
Update baselines and add fourslash
1 parent 4980fa4 commit aace2c3

7 files changed

+172
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
//// [emitClassDeclarationWithPropertyAccessInHeritageClause1.ts]
2+
interface I {}
3+
interface CTor {
4+
new (hour: number, minute: number): I
5+
}
6+
var x: {
7+
B : CTor
8+
};
9+
class B {}
10+
function foo() {
11+
return {B: B};
12+
}
13+
class C extends (foo()).B {}
14+
15+
//// [emitClassDeclarationWithPropertyAccessInHeritageClause1.js]
16+
var __extends = (this && this.__extends) || (function () {
17+
var extendStatics = Object.setPrototypeOf ||
18+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
19+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
20+
return function (d, b) {
21+
extendStatics(d, b);
22+
function __() { this.constructor = d; }
23+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
24+
};
25+
})();
26+
var x;
27+
var B = (function () {
28+
function B() {
29+
}
30+
return B;
31+
}());
32+
function foo() {
33+
return { B: B };
34+
}
35+
var C = (function (_super) {
36+
__extends(C, _super);
37+
function C() {
38+
return _super !== null && _super.apply(this, arguments) || this;
39+
}
40+
return C;
41+
}((foo()).B));
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
=== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithPropertyAccessInHeritageClause1.ts ===
2+
interface I {}
3+
>I : Symbol(I, Decl(emitClassDeclarationWithPropertyAccessInHeritageClause1.ts, 0, 0))
4+
5+
interface CTor {
6+
>CTor : Symbol(CTor, Decl(emitClassDeclarationWithPropertyAccessInHeritageClause1.ts, 0, 14))
7+
8+
new (hour: number, minute: number): I
9+
>hour : Symbol(hour, Decl(emitClassDeclarationWithPropertyAccessInHeritageClause1.ts, 2, 9))
10+
>minute : Symbol(minute, Decl(emitClassDeclarationWithPropertyAccessInHeritageClause1.ts, 2, 22))
11+
>I : Symbol(I, Decl(emitClassDeclarationWithPropertyAccessInHeritageClause1.ts, 0, 0))
12+
}
13+
var x: {
14+
>x : Symbol(x, Decl(emitClassDeclarationWithPropertyAccessInHeritageClause1.ts, 4, 3))
15+
16+
B : CTor
17+
>B : Symbol(B, Decl(emitClassDeclarationWithPropertyAccessInHeritageClause1.ts, 4, 8))
18+
>CTor : Symbol(CTor, Decl(emitClassDeclarationWithPropertyAccessInHeritageClause1.ts, 0, 14))
19+
20+
};
21+
class B {}
22+
>B : Symbol(B, Decl(emitClassDeclarationWithPropertyAccessInHeritageClause1.ts, 6, 2))
23+
24+
function foo() {
25+
>foo : Symbol(foo, Decl(emitClassDeclarationWithPropertyAccessInHeritageClause1.ts, 7, 10))
26+
27+
return {B: B};
28+
>B : Symbol(B, Decl(emitClassDeclarationWithPropertyAccessInHeritageClause1.ts, 9, 12))
29+
>B : Symbol(B, Decl(emitClassDeclarationWithPropertyAccessInHeritageClause1.ts, 6, 2))
30+
}
31+
class C extends (foo()).B {}
32+
>C : Symbol(C, Decl(emitClassDeclarationWithPropertyAccessInHeritageClause1.ts, 10, 1))
33+
>(foo()).B : Symbol(B, Decl(emitClassDeclarationWithPropertyAccessInHeritageClause1.ts, 9, 12))
34+
>foo : Symbol(foo, Decl(emitClassDeclarationWithPropertyAccessInHeritageClause1.ts, 7, 10))
35+
>B : Symbol(B, Decl(emitClassDeclarationWithPropertyAccessInHeritageClause1.ts, 9, 12))
36+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
=== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithPropertyAccessInHeritageClause1.ts ===
2+
interface I {}
3+
>I : I
4+
5+
interface CTor {
6+
>CTor : CTor
7+
8+
new (hour: number, minute: number): I
9+
>hour : number
10+
>minute : number
11+
>I : I
12+
}
13+
var x: {
14+
>x : { B: CTor; }
15+
16+
B : CTor
17+
>B : CTor
18+
>CTor : CTor
19+
20+
};
21+
class B {}
22+
>B : B
23+
24+
function foo() {
25+
>foo : () => { B: typeof B; }
26+
27+
return {B: B};
28+
>{B: B} : { B: typeof B; }
29+
>B : typeof B
30+
>B : typeof B
31+
}
32+
class C extends (foo()).B {}
33+
>C : C
34+
>(foo()).B : B
35+
>(foo()) : { B: typeof B; }
36+
>foo() : { B: typeof B; }
37+
>foo : () => { B: typeof B; }
38+
>B : typeof B
39+

tests/baselines/reference/reexportClassDefinition.symbols

+2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import foo2 = require('./foo2')
44

55
class x extends foo2.x {}
66
>x : Symbol(x, Decl(foo3.ts, 0, 31))
7+
>foo2.x : Symbol(x, Decl(foo2.ts, 2, 10))
78
>foo2 : Symbol(foo2, Decl(foo3.ts, 0, 0))
9+
>x : Symbol(x, Decl(foo2.ts, 2, 10))
810

911

1012
=== tests/cases/conformance/externalModules/foo1.ts ===
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
//// interface I {}
4+
//// interface CTor {
5+
//// new (hour: number, minute: number): I
6+
//// }
7+
//// var x: {
8+
//// B : CTor
9+
//// };
10+
//// class B {}
11+
//// function foo() {
12+
//// return {[|B|]: B};
13+
//// }
14+
//// class C extends (foo()).[|B|] {}
15+
//// class C1 extends foo().[|B|] {}
16+
17+
const [def, ref1, ref2] = test.ranges();
18+
verify.referencesOf(ref1, [def, ref1, ref2]);
19+
verify.referencesOf(ref2, [def, ref1, ref2]);
20+
verify.referencesOf(def, [def, ref1, ref2]);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/// <reference path='fourslash.ts' />
2+
3+
//// interface I {}
4+
//// interface CTor {
5+
//// new (hour: number, minute: number): I
6+
//// }
7+
//// var x: {
8+
//// B : CTor
9+
//// };
10+
//// class B {}
11+
//// function foo() {
12+
//// return {/*refB*/B: B};
13+
//// }
14+
//// class C extends (foo())./*B*/B {}
15+
//// class C1 extends foo()./*B1*/B {}
16+
17+
verify.goToDefinition([["B", "refB"], ["B1", "refB"]]);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
//// interface I {}
4+
//// interface CTor {
5+
//// new (hour: number, minute: number): I
6+
//// }
7+
//// var x: {
8+
//// B : CTor
9+
//// };
10+
//// class B {}
11+
//// function foo() {
12+
//// return {[|B|]: B};
13+
//// }
14+
//// class C extends (foo()).[|B|] {}
15+
//// class C1 extends foo().[|B|] {}
16+
17+
verify.rangesAreRenameLocations();

0 commit comments

Comments
 (0)