mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-10 21:07:52 -05:00
Added tests for getOccurrences on this in class expressions
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
54
tests/cases/fourslash/getOccurrencesClassExpressionThis.ts
Normal file
54
tests/cases/fourslash/getOccurrencesClassExpressionThis.ts
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user