Short-circuit semantic operations within with blocks

This commit is contained in:
Mohamed Hegazy
2014-09-12 15:31:47 -07:00
parent 85c6d34047
commit aa571ff088
6 changed files with 73 additions and 1 deletions

View File

@@ -0,0 +1,16 @@
/// <reference path='fourslash.ts'/>
////var x = 0;
////
////with ({}) {
//// var y = x; // Reference of x here should not be picked
//// /*2*/y++; // also reference for y should be ignored
////}
////
////x = /*1*/x + 1;
goTo.marker('1');
verify.referencesCountIs(3);
goTo.marker('2');
verify.referencesCountIs(1);

View File

@@ -15,8 +15,10 @@ goTo.marker('1');
verify.memberListIsEmpty();
goTo.marker('2');
// Only keywords should show in completion, no members or types
verify.not.completionListContains("foo");
verify.not.completionListContains("f");
verify.not.completionListContains("c");
verify.not.completionListContains("d");
verify.not.completionListContains("x");
verify.not.completionListContains("Object");

View File

@@ -0,0 +1,12 @@
/// <reference path='fourslash.ts'/>
////interface IFoo {
//// a: number;
////}
////
////with (x) {
//// var y: IFoo = { /*1*/ };
////}
goTo.marker('1');
verify.memberListIsEmpty();

View File

@@ -0,0 +1,7 @@
/// <reference path='fourslash.ts'/>
////var x = { a: 0 };
////with(x./*1*/
goTo.marker('1');
verify.memberListContains("a");