mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 16:38:05 -06:00
TODOs for repeated substitution
This commit is contained in:
parent
e6bfce193c
commit
386e76543a
@ -62,6 +62,13 @@ namespace ts {
|
||||
let x = [#|t + 1|];
|
||||
}`);
|
||||
|
||||
// TODO (acasey): handle repeated substitution
|
||||
// testExtractConstant("extractConstant_RepeatedSubstitution",
|
||||
// `namespace X {
|
||||
// export const j = 10;
|
||||
// export const y = [#|j * j|];
|
||||
// }`);
|
||||
|
||||
testExtractConstantFailed("extractConstant_BlockScopes_Dependencies",
|
||||
`for (let i = 0; i < 10; i++) {
|
||||
for (let j = 0; j < 10; j++) {
|
||||
|
||||
@ -364,6 +364,13 @@ function parsePrimaryExpression(): any {
|
||||
`function F() {
|
||||
[#|function G() { }|]
|
||||
}`);
|
||||
|
||||
// TODO (acasey): handle repeated substitution
|
||||
// testExtractMethod("extractMethod_RepeatedSubstitution",
|
||||
// `namespace X {
|
||||
// export const j = 10;
|
||||
// export const y = [#|j * j|];
|
||||
// }`);
|
||||
});
|
||||
|
||||
function testExtractMethod(caption: string, text: string) {
|
||||
|
||||
@ -1382,9 +1382,9 @@ namespace ts.refactor.extractSymbol {
|
||||
if (symbolId) {
|
||||
for (let i = 0; i < scopes.length; i++) {
|
||||
// push substitution from map<symbolId, subst> to map<nodeId, subst> to simplify rewriting
|
||||
const substitition = substitutionsPerScope[i].get(symbolId);
|
||||
if (substitition) {
|
||||
usagesPerScope[i].substitutions.set(getNodeId(n).toString(), substitition);
|
||||
const substitution = substitutionsPerScope[i].get(symbolId);
|
||||
if (substitution) {
|
||||
usagesPerScope[i].substitutions.set(getNodeId(n).toString(), substitution);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user