TypeScript/tests/cases/fourslash/getOccurrencesThrow5.ts
Daniel Rosenwasser 16d969c9ca Support getOccurrencesAtPosition for 'throw' keywords.
Also revised behavior for 'return' keywords in that when the position
resides on a 'return' statement, 'throw' keywords in the same
function scope that are not within a try-block are also highlighted.
2014-09-28 20:39:09 -04:00

59 lines
1.2 KiB
TypeScript

/// <reference path='fourslash.ts' />
////function f(a: number) {
//// try {
//// throw "Hello";
////
//// try {
//// throw 10;
//// }
//// catch (x) {
//// return 100;
//// }
//// finally {
//// throw 10;
//// }
//// }
//// catch (x) {
//// throw "Something";
//// }
//// finally {
//// throw "Also something";
//// }
//// if (a > 0) {
//// return (function () {
//// return;
//// return;
//// return;
////
//// if (false) {
//// return true;
//// }
//// throw "Hello!";
//// })() || true;
//// }
////
//// throw 10;
////
//// var unusued = [1, 2, 3, 4].map(x => { [|thr/**/ow|] 4 })
////
//// return;
//// return true;
//// throw false;
////}
test.ranges().forEach(r => {
goTo.position(r.start);
test.ranges().forEach(range => {
verify.occurrencesAtPositionContains(range, false);
});
verify.occurrencesAtPositionCount(test.ranges().length);
});
goTo.marker();
test.ranges().forEach(range => {
verify.occurrencesAtPositionContains(range, false);
});