Added tests for getOccurrences on this in class expressions

This commit is contained in:
Dick van den Brink
2015-08-28 20:05:54 +02:00
parent 8028ab56c5
commit 1f8de043a1
2 changed files with 110 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
/// <reference path='fourslash.ts' />
////var x = class C {
//// public x;
//// public y;
//// public z;
//// public staticX;
//// constructor() {
//// this;
//// this.x;
//// this.y;
//// this.z;
//// }
//// foo() {
//// this;
//// () => this;
//// () => {
//// if (this) {
//// this;
//// }
//// }
//// function inside() {
//// this;
//// (function (_) {
//// this;
//// })(this);
//// }
//// return this.x;
//// }
////
//// static bar() {
//// [|this|];
//// [|this|].staticX;
//// () => [|this|];
//// () => {
//// if ([|this|]) {
//// [|this|];
//// }
//// }
//// function inside() {
//// this;
//// (function (_) {
//// this;
//// })(this);
//// }
//// }
////}
const ranges = test.ranges();
for (let r of ranges) {
goTo.position(r.start);
for (let range of ranges) {
verify.occurrencesAtPositionContains(range, false);
}
}

View File

@@ -0,0 +1,54 @@
/// <reference path='fourslash.ts' />
////var x = class C {
//// public x;
//// public y;
//// public z;
//// constructor() {
//// [|this|];
//// [|this|].x;
//// [|this|].y;
//// [|this|].z;
//// }
//// foo() {
//// [|this|];
//// () => [|this|];
//// () => {
//// if ([|this|]) {
//// [|this|];
//// }
//// }
//// function inside() {
//// this;
//// (function (_) {
//// this;
//// })(this);
//// }
//// return [|this|].x;
//// }
////
//// static bar() {
//// this;
//// () => this;
//// () => {
//// if (this) {
//// this;
//// }
//// }
//// function inside() {
//// this;
//// (function (_) {
//// this;
//// })(this);
//// }
//// }
////}
const ranges = test.ranges();
for (let r of ranges) {
goTo.position(r.start);
for (let range of ranges) {
verify.occurrencesAtPositionContains(range, false);
}
}