Update baselines and add fourslash

This commit is contained in:
Kanchalai Tanglertsampan 2017-03-16 13:39:30 -07:00
parent 4980fa4d5d
commit aace2c358f
7 changed files with 172 additions and 0 deletions

View file

@ -0,0 +1,41 @@
//// [emitClassDeclarationWithPropertyAccessInHeritageClause1.ts]
interface I {}
interface CTor {
new (hour: number, minute: number): I
}
var x: {
B : CTor
};
class B {}
function foo() {
return {B: B};
}
class C extends (foo()).B {}
//// [emitClassDeclarationWithPropertyAccessInHeritageClause1.js]
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var x;
var B = (function () {
function B() {
}
return B;
}());
function foo() {
return { B: B };
}
var C = (function (_super) {
__extends(C, _super);
function C() {
return _super !== null && _super.apply(this, arguments) || this;
}
return C;
}((foo()).B));

View file

@ -0,0 +1,36 @@
=== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithPropertyAccessInHeritageClause1.ts ===
interface I {}
>I : Symbol(I, Decl(emitClassDeclarationWithPropertyAccessInHeritageClause1.ts, 0, 0))
interface CTor {
>CTor : Symbol(CTor, Decl(emitClassDeclarationWithPropertyAccessInHeritageClause1.ts, 0, 14))
new (hour: number, minute: number): I
>hour : Symbol(hour, Decl(emitClassDeclarationWithPropertyAccessInHeritageClause1.ts, 2, 9))
>minute : Symbol(minute, Decl(emitClassDeclarationWithPropertyAccessInHeritageClause1.ts, 2, 22))
>I : Symbol(I, Decl(emitClassDeclarationWithPropertyAccessInHeritageClause1.ts, 0, 0))
}
var x: {
>x : Symbol(x, Decl(emitClassDeclarationWithPropertyAccessInHeritageClause1.ts, 4, 3))
B : CTor
>B : Symbol(B, Decl(emitClassDeclarationWithPropertyAccessInHeritageClause1.ts, 4, 8))
>CTor : Symbol(CTor, Decl(emitClassDeclarationWithPropertyAccessInHeritageClause1.ts, 0, 14))
};
class B {}
>B : Symbol(B, Decl(emitClassDeclarationWithPropertyAccessInHeritageClause1.ts, 6, 2))
function foo() {
>foo : Symbol(foo, Decl(emitClassDeclarationWithPropertyAccessInHeritageClause1.ts, 7, 10))
return {B: B};
>B : Symbol(B, Decl(emitClassDeclarationWithPropertyAccessInHeritageClause1.ts, 9, 12))
>B : Symbol(B, Decl(emitClassDeclarationWithPropertyAccessInHeritageClause1.ts, 6, 2))
}
class C extends (foo()).B {}
>C : Symbol(C, Decl(emitClassDeclarationWithPropertyAccessInHeritageClause1.ts, 10, 1))
>(foo()).B : Symbol(B, Decl(emitClassDeclarationWithPropertyAccessInHeritageClause1.ts, 9, 12))
>foo : Symbol(foo, Decl(emitClassDeclarationWithPropertyAccessInHeritageClause1.ts, 7, 10))
>B : Symbol(B, Decl(emitClassDeclarationWithPropertyAccessInHeritageClause1.ts, 9, 12))

View file

@ -0,0 +1,39 @@
=== tests/cases/conformance/es6/classDeclaration/emitClassDeclarationWithPropertyAccessInHeritageClause1.ts ===
interface I {}
>I : I
interface CTor {
>CTor : CTor
new (hour: number, minute: number): I
>hour : number
>minute : number
>I : I
}
var x: {
>x : { B: CTor; }
B : CTor
>B : CTor
>CTor : CTor
};
class B {}
>B : B
function foo() {
>foo : () => { B: typeof B; }
return {B: B};
>{B: B} : { B: typeof B; }
>B : typeof B
>B : typeof B
}
class C extends (foo()).B {}
>C : C
>(foo()).B : B
>(foo()) : { B: typeof B; }
>foo() : { B: typeof B; }
>foo : () => { B: typeof B; }
>B : typeof B

View file

@ -4,7 +4,9 @@ import foo2 = require('./foo2')
class x extends foo2.x {}
>x : Symbol(x, Decl(foo3.ts, 0, 31))
>foo2.x : Symbol(x, Decl(foo2.ts, 2, 10))
>foo2 : Symbol(foo2, Decl(foo3.ts, 0, 0))
>x : Symbol(x, Decl(foo2.ts, 2, 10))
=== tests/cases/conformance/externalModules/foo1.ts ===

View file

@ -0,0 +1,20 @@
/// <reference path="fourslash.ts" />
//// interface I {}
//// interface CTor {
//// new (hour: number, minute: number): I
//// }
//// var x: {
//// B : CTor
//// };
//// class B {}
//// function foo() {
//// return {[|B|]: B};
//// }
//// class C extends (foo()).[|B|] {}
//// class C1 extends foo().[|B|] {}
const [def, ref1, ref2] = test.ranges();
verify.referencesOf(ref1, [def, ref1, ref2]);
verify.referencesOf(ref2, [def, ref1, ref2]);
verify.referencesOf(def, [def, ref1, ref2]);

View file

@ -0,0 +1,17 @@
/// <reference path='fourslash.ts' />
//// interface I {}
//// interface CTor {
//// new (hour: number, minute: number): I
//// }
//// var x: {
//// B : CTor
//// };
//// class B {}
//// function foo() {
//// return {/*refB*/B: B};
//// }
//// class C extends (foo())./*B*/B {}
//// class C1 extends foo()./*B1*/B {}
verify.goToDefinition([["B", "refB"], ["B1", "refB"]]);

View file

@ -0,0 +1,17 @@
/// <reference path="fourslash.ts" />
//// interface I {}
//// interface CTor {
//// new (hour: number, minute: number): I
//// }
//// var x: {
//// B : CTor
//// };
//// class B {}
//// function foo() {
//// return {[|B|]: B};
//// }
//// class C extends (foo()).[|B|] {}
//// class C1 extends foo().[|B|] {}
verify.rangesAreRenameLocations();