Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18448 from amcasey/NestedReturn
Only introduce return properties at the top level (cherry picked from commit 288a57c)
- Loading branch information
Showing
4 changed files
with
125 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
tests/baselines/reference/extractMethod/extractMethod31.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// ==ORIGINAL== | ||
namespace N { | ||
|
||
export const value = 1; | ||
|
||
() => { | ||
var f: () => number; | ||
f = function (): number { | ||
return value; | ||
} | ||
} | ||
} | ||
// ==SCOPE::namespace 'N'== | ||
namespace N { | ||
|
||
export const value = 1; | ||
|
||
() => { | ||
var f: () => number; | ||
f = /*RENAME*/newFunction(f); | ||
} | ||
|
||
function newFunction(f: () => number) { | ||
f = function(): number { | ||
return value; | ||
}; | ||
return f; | ||
} | ||
} | ||
// ==SCOPE::global scope== | ||
namespace N { | ||
|
||
export const value = 1; | ||
|
||
() => { | ||
var f: () => number; | ||
f = /*RENAME*/newFunction(f); | ||
} | ||
} | ||
function newFunction(f: () => number) { | ||
f = function(): number { | ||
return N.value; | ||
}; | ||
return f; | ||
} |
46 changes: 46 additions & 0 deletions
46
tests/baselines/reference/extractMethod/extractMethod32.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// ==ORIGINAL== | ||
namespace N { | ||
|
||
export const value = 1; | ||
|
||
() => { | ||
var c = class { | ||
M() { | ||
return value; | ||
} | ||
} | ||
} | ||
} | ||
// ==SCOPE::namespace 'N'== | ||
namespace N { | ||
|
||
export const value = 1; | ||
|
||
() => { | ||
/*RENAME*/newFunction(); | ||
} | ||
|
||
function newFunction() { | ||
var c = class { | ||
M() { | ||
return value; | ||
} | ||
}; | ||
} | ||
} | ||
// ==SCOPE::global scope== | ||
namespace N { | ||
|
||
export const value = 1; | ||
|
||
() => { | ||
/*RENAME*/newFunction(); | ||
} | ||
} | ||
function newFunction() { | ||
var c = class { | ||
M() { | ||
return N.value; | ||
} | ||
}; | ||
} |