mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Add missing test coverage for jumps in finally blocks
This commit is contained in:
@@ -152,6 +152,16 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
`);
|
||||
testExtractRange(`
|
||||
function f(x: number) {
|
||||
[#|[$|try {
|
||||
x++;
|
||||
}
|
||||
finally {
|
||||
return 1;
|
||||
}|]|]
|
||||
}
|
||||
`);
|
||||
});
|
||||
|
||||
testExtractRangeFailed("extractRangeFailed1",
|
||||
@@ -313,6 +323,23 @@ switch (x) {
|
||||
refactor.extractSymbol.Messages.CannotExtractRange.message
|
||||
]);
|
||||
|
||||
testExtractRangeFailed("extractRangeFailed11",
|
||||
`
|
||||
function f(x: number) {
|
||||
while (true) {
|
||||
[#|try {
|
||||
x++;
|
||||
}
|
||||
finally {
|
||||
break;
|
||||
}|]
|
||||
}
|
||||
}
|
||||
`,
|
||||
[
|
||||
refactor.extractSymbol.Messages.CannotExtractRangeContainingConditionalBreakOrContinueStatements.message
|
||||
]);
|
||||
|
||||
testExtractRangeFailed("extract-method-not-for-token-expression-statement", `[#|a|]`, [refactor.extractSymbol.Messages.CannotExtractIdentifier.message]);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user