Tidy up Extract Method fourslash tests

Partial port of ea4fdc5a9
This commit is contained in:
Andrew Casey committed 2017-09-19 17:31:17 -07:00
1 parent 4a63ed7afa
commit f80995653a
25 files changed
+59 -1036

No files matched your search

+4 -4
View File
@@ -552,7 +552,7 @@ namespace A {
function testExtractMethod(caption: string, text: string) {
it(caption, () => {
Harness.Baseline.runBaseline(`extractMethod/${caption}.js`, () => {
Harness.Baseline.runBaseline(`extractMethod/${caption}.ts`, () => {
const t = extractTest(text);
const selectionRange = t.ranges.get("selection");
if (!selectionRange) {
@@ -562,7 +562,7 @@ namespace A {
path: "/a.ts",
content: t.source
};
const host = projectSystem.createServerHost([f]);
const host = projectSystem.createServerHost([f, projectSystem.libFile]);
const projectService = projectSystem.createProjectService(host);
projectService.openClientFile(f.path);
const program = projectService.inferredProjects[0].getLanguageService().getProgram();
@@ -579,12 +579,12 @@ namespace A {
assert.equal(result.errors, undefined, "expect no errors");
const results = refactor.extractMethod.getPossibleExtractions(result.targetRange, context);
const data: string[] = [];
data.push(`==ORIGINAL==`);
data.push(`// ==ORIGINAL==`);
data.push(sourceFile.text);
for (const r of results) {
const { renameLocation, edits } = refactor.extractMethod.getExtractionAtIndex(result.targetRange, context, results.indexOf(r));
assert.lengthOf(edits, 1);
data.push(`==SCOPE::${r.scopeDescription}==`);
data.push(`// ==SCOPE::${r.scopeDescription}==`);
const newText = textChanges.applyChanges(sourceFile.text, edits[0].textChanges);
const newTextWithRename = newText.slice(0, renameLocation) + "/*RENAME*/" + newText.slice(renameLocation);
data.push(newTextWithRename);
@@ -1,4 +1,4 @@
==ORIGINAL==
// ==ORIGINAL==
namespace A {
let x = 1;
function foo() {
@@ -14,7 +14,7 @@ namespace A {
}
}
}
==SCOPE::function 'a'==
// ==SCOPE::function 'a'==
namespace A {
let x = 1;
function foo() {
@@ -34,7 +34,7 @@ namespace A {
}
}
}
==SCOPE::namespace 'B'==
// ==SCOPE::namespace 'B'==
namespace A {
let x = 1;
function foo() {
@@ -55,7 +55,7 @@ namespace A {
}
}
}
==SCOPE::namespace 'A'==
// ==SCOPE::namespace 'A'==
namespace A {
let x = 1;
function foo() {
@@ -76,7 +76,7 @@ namespace A {
return a;
}
}
==SCOPE::global scope==
// ==SCOPE::global scope==
namespace A {
let x = 1;
function foo() {
@@ -1,4 +1,4 @@
==ORIGINAL==
// ==ORIGINAL==
namespace A {
export interface I { x: number };
class C {
@@ -9,7 +9,7 @@ namespace A {
}
}
}
==SCOPE::class 'C'==
// ==SCOPE::class 'C'==
namespace A {
export interface I { x: number };
class C {
@@ -24,7 +24,7 @@ namespace A {
}
}
}
==SCOPE::namespace 'A'==
// ==SCOPE::namespace 'A'==
namespace A {
export interface I { x: number };
class C {
@@ -39,7 +39,7 @@ namespace A {
return a1.x + 10;
}
}
==SCOPE::global scope==
// ==SCOPE::global scope==
namespace A {
export interface I { x: number };
class C {
@@ -1,4 +1,4 @@
==ORIGINAL==
// ==ORIGINAL==
namespace A {
let y = 1;
class C {
@@ -11,7 +11,7 @@ namespace A {
}
}
}
==SCOPE::class 'C'==
// ==SCOPE::class 'C'==
namespace A {
let y = 1;
class C {
@@ -30,7 +30,7 @@ namespace A {
}
}
}
==SCOPE::namespace 'A'==
// ==SCOPE::namespace 'A'==
namespace A {
let y = 1;
class C {
@@ -49,7 +49,7 @@ namespace A {
return { __return: a1.x + 10, z };
}
}
==SCOPE::global scope==
// ==SCOPE::global scope==
namespace A {
let y = 1;
class C {
@@ -1,4 +1,4 @@
==ORIGINAL==
// ==ORIGINAL==
namespace A {
let y = 1;
class C {
@@ -13,7 +13,7 @@ namespace A {
}
}
}
==SCOPE::class 'C'==
// ==SCOPE::class 'C'==
namespace A {
let y = 1;
class C {
@@ -1,4 +1,4 @@
==ORIGINAL==
// ==ORIGINAL==
namespace A {
let x = 1;
function foo() {
@@ -12,7 +12,7 @@ namespace A {
}
}
}
==SCOPE::function 'a'==
// ==SCOPE::function 'a'==
namespace A {
let x = 1;
function foo() {
@@ -30,7 +30,7 @@ namespace A {
}
}
}
==SCOPE::namespace 'B'==
// ==SCOPE::namespace 'B'==
namespace A {
let x = 1;
function foo() {
@@ -48,7 +48,7 @@ namespace A {
}
}
}
==SCOPE::namespace 'A'==
// ==SCOPE::namespace 'A'==
namespace A {
let x = 1;
function foo() {
@@ -66,7 +66,7 @@ namespace A {
return foo();
}
}
==SCOPE::global scope==
// ==SCOPE::global scope==
namespace A {
let x = 1;
function foo() {
@@ -1,4 +1,4 @@
==ORIGINAL==
// ==ORIGINAL==
namespace A {
function foo() {
}
@@ -11,7 +11,7 @@ namespace A {
}
}
}
==SCOPE::function 'a'==
// ==SCOPE::function 'a'==
namespace A {
function foo() {
}
@@ -28,7 +28,7 @@ namespace A {
}
}
}
==SCOPE::namespace 'B'==
// ==SCOPE::namespace 'B'==
namespace A {
function foo() {
}
@@ -45,7 +45,7 @@ namespace A {
}
}
}
==SCOPE::namespace 'A'==
// ==SCOPE::namespace 'A'==
namespace A {
function foo() {
}
@@ -62,7 +62,7 @@ namespace A {
return foo();
}
}
==SCOPE::global scope==
// ==SCOPE::global scope==
namespace A {
function foo() {
}
@@ -1,4 +1,4 @@
==ORIGINAL==
// ==ORIGINAL==
namespace A {
function foo() {
}
@@ -13,7 +13,7 @@ namespace A {
}
}
}
==SCOPE::function 'a'==
// ==SCOPE::function 'a'==
namespace A {
function foo() {
}
@@ -32,7 +32,7 @@ namespace A {
}
}
}
==SCOPE::namespace 'B'==
// ==SCOPE::namespace 'B'==
namespace A {
function foo() {
}
@@ -51,7 +51,7 @@ namespace A {
}
}
}
==SCOPE::namespace 'A'==
// ==SCOPE::namespace 'A'==
namespace A {
function foo() {
}
@@ -70,7 +70,7 @@ namespace A {
return foo();
}
}
==SCOPE::global scope==
// ==SCOPE::global scope==
namespace A {
function foo() {
}
@@ -1,4 +1,4 @@
==ORIGINAL==
// ==ORIGINAL==
namespace A {
let x = 1;
export function foo() {
@@ -14,7 +14,7 @@ namespace A {
}
}
}
==SCOPE::function 'a'==
// ==SCOPE::function 'a'==
namespace A {
let x = 1;
export function foo() {
@@ -34,7 +34,7 @@ namespace A {
}
}
}
==SCOPE::namespace 'B'==
// ==SCOPE::namespace 'B'==
namespace A {
let x = 1;
export function foo() {
@@ -55,7 +55,7 @@ namespace A {
}
}
}
==SCOPE::namespace 'A'==
// ==SCOPE::namespace 'A'==
namespace A {
let x = 1;
export function foo() {
@@ -76,7 +76,7 @@ namespace A {
return a;
}
}
==SCOPE::global scope==
// ==SCOPE::global scope==
namespace A {
let x = 1;
export function foo() {
@@ -1,4 +1,4 @@
==ORIGINAL==
// ==ORIGINAL==
namespace A {
let x = 1;
export function foo() {
@@ -14,7 +14,7 @@ namespace A {
}
}
}
==SCOPE::function 'a'==
// ==SCOPE::function 'a'==
namespace A {
let x = 1;
export function foo() {
@@ -34,7 +34,7 @@ namespace A {
}
}
}
==SCOPE::namespace 'B'==
// ==SCOPE::namespace 'B'==
namespace A {
let x = 1;
export function foo() {
@@ -56,7 +56,7 @@ namespace A {
}
}
}
==SCOPE::namespace 'A'==
// ==SCOPE::namespace 'A'==
namespace A {
let x = 1;
export function foo() {
@@ -78,7 +78,7 @@ namespace A {
return { __return: foo(), a };
}
}
==SCOPE::global scope==
// ==SCOPE::global scope==
namespace A {
let x = 1;
export function foo() {
@@ -1,4 +1,4 @@
==ORIGINAL==
// ==ORIGINAL==
namespace A {
let x = 1;
export namespace C {
@@ -16,7 +16,7 @@ namespace A {
}
}
}
==SCOPE::function 'a'==
// ==SCOPE::function 'a'==
namespace A {
let x = 1;
export namespace C {
@@ -38,7 +38,7 @@ namespace A {
}
}
}
==SCOPE::namespace 'B'==
// ==SCOPE::namespace 'B'==
namespace A {
let x = 1;
export namespace C {
@@ -62,7 +62,7 @@ namespace A {
}
}
}
==SCOPE::namespace 'A'==
// ==SCOPE::namespace 'A'==
namespace A {
let x = 1;
export namespace C {
@@ -86,7 +86,7 @@ namespace A {
return { __return: C.foo(), a };
}
}
==SCOPE::global scope==
// ==SCOPE::global scope==
namespace A {
let x = 1;
export namespace C {
@@ -1,4 +1,4 @@
==ORIGINAL==
// ==ORIGINAL==
namespace A {
let x = 1;
namespace B {
@@ -8,7 +8,7 @@ namespace A {
}
}
}
==SCOPE::function 'a'==
// ==SCOPE::function 'a'==
namespace A {
let x = 1;
namespace B {
@@ -22,7 +22,7 @@ namespace A {
}
}
}
==SCOPE::namespace 'B'==
// ==SCOPE::namespace 'B'==
namespace A {
let x = 1;
namespace B {
@@ -36,7 +36,7 @@ namespace A {
}
}
}
==SCOPE::namespace 'A'==
// ==SCOPE::namespace 'A'==
namespace A {
let x = 1;
namespace B {
@@ -50,7 +50,7 @@ namespace A {
return 1 + a1 + x;
}
}
==SCOPE::global scope==
// ==SCOPE::global scope==
namespace A {
let x = 1;
namespace B {
@@ -1,4 +1,4 @@
==ORIGINAL==
// ==ORIGINAL==
namespace A {
export interface I { x: number };
namespace B {
@@ -8,7 +8,7 @@ namespace A {
}
}
}
==SCOPE::function 'a'==
// ==SCOPE::function 'a'==
namespace A {
export interface I { x: number };
namespace B {
@@ -22,7 +22,7 @@ namespace A {
}
}
}
==SCOPE::namespace 'B'==
// ==SCOPE::namespace 'B'==
namespace A {
export interface I { x: number };
namespace B {
@@ -36,7 +36,7 @@ namespace A {
}
}
}
==SCOPE::namespace 'A'==
// ==SCOPE::namespace 'A'==
namespace A {
export interface I { x: number };
namespace B {
@@ -50,7 +50,7 @@ namespace A {
return a1.x + 10;
}
}
==SCOPE::global scope==
// ==SCOPE::global scope==
namespace A {
export interface I { x: number };
namespace B {
@@ -1,98 +0,0 @@
==ORIGINAL==
namespace A {
let x = 1;
function foo() {
}
namespace B {
function a() {
let a = 1;
let y = 5;
let z = x;
a = y;
foo();
}
}
}
==SCOPE::function a==
namespace A {
let x = 1;
function foo() {
}
namespace B {
function a() {
let a = 1;
newFunction();
function newFunction() {
let y = 5;
let z = x;
a = y;
foo();
}
}
}
}
==SCOPE::namespace B==
namespace A {
let x = 1;
function foo() {
}
namespace B {
function a() {
let a = 1;
({ a } = newFunction(a));
}
function newFunction(a: any) {
let y = 5;
let z = x;
a = y;
foo();
return { a };
}
}
}
==SCOPE::namespace A==
namespace A {
let x = 1;
function foo() {
}
namespace B {
function a() {
let a = 1;
({ a } = newFunction(a));
}
}
function newFunction(a: any) {
let y = 5;
let z = x;
a = y;
foo();
return { a };
}
}
==SCOPE::file '/a.ts'==
namespace A {
let x = 1;
function foo() {
}
namespace B {
function a() {
let a = 1;
({ a } = newFunction(x, a, foo));
}
}
}
function newFunction(x: any, a: any, foo: any) {
let y = 5;
let z = x;
a = y;
foo();
return { a };
}
@@ -1,70 +0,0 @@
==ORIGINAL==
namespace A {
export interface I { x: number };
class C {
a() {
let z = 1;
let a1: I = { x: 1 };
return a1.x + 10;
}
}
}
==SCOPE::method a==
namespace A {
export interface I { x: number };
class C {
a() {
let z = 1;
return newFunction();
function newFunction() {
let a1: I = { x: 1 };
return a1.x + 10;
}
}
}
}
==SCOPE::class C==
namespace A {
export interface I { x: number };
class C {
a() {
let z = 1;
return this.newFunction();
}
private newFunction() {
let a1: I = { x: 1 };
return a1.x + 10;
}
}
}
==SCOPE::namespace A==
namespace A {
export interface I { x: number };
class C {
a() {
let z = 1;
return newFunction();
}
}
function newFunction() {
let a1: I = { x: 1 };
return a1.x + 10;
}
}
==SCOPE::file '/a.ts'==
namespace A {
export interface I { x: number };
class C {
a() {
let z = 1;
return newFunction();
}
}
}
function newFunction() {
let a1: A.I = { x: 1 };
return a1.x + 10;
}
@@ -1,86 +0,0 @@
==ORIGINAL==
namespace A {
let y = 1;
class C {
a() {
let z = 1;
let a1 = { x: 1 };
y = 10;
z = 42;
return a1.x + 10;
}
}
}
==SCOPE::method a==
namespace A {
let y = 1;
class C {
a() {
let z = 1;
return newFunction();
function newFunction() {
let a1 = { x: 1 };
y = 10;
z = 42;
return a1.x + 10;
}
}
}
}
==SCOPE::class C==
namespace A {
let y = 1;
class C {
a() {
let z = 1;
var __return: any;
({ z, __return } = this.newFunction(z));
return __return;
}
private newFunction(z: any) {
let a1 = { x: 1 };
y = 10;
z = 42;
return { z, __return: a1.x + 10 };
}
}
}
==SCOPE::namespace A==
namespace A {
let y = 1;
class C {
a() {
let z = 1;
var __return: any;
({ z, __return } = newFunction(z));
return __return;
}
}
function newFunction(z: any) {
let a1 = { x: 1 };
y = 10;
z = 42;
return { z, __return: a1.x + 10 };
}
}
==SCOPE::file '/a.ts'==
namespace A {
let y = 1;
class C {
a() {
let z = 1;
var __return: any;
({ y, z, __return } = newFunction(y, z));
return __return;
}
}
}
function newFunction(y: any, z: any) {
let a1 = { x: 1 };
y = 10;
z = 42;
return { y, z, __return: a1.x + 10 };
}
@@ -1,36 +0,0 @@
==ORIGINAL==
namespace A {
let y = 1;
class C {
b() {}
a() {
let z = 1;
let a1 = { x: 1 };
y = 10;
z = 42;
this.b();
return a1.x + 10;
}
}
}
==SCOPE::class C==
namespace A {
let y = 1;
class C {
b() {}
a() {
let z = 1;
var __return: any;
({ z, __return } = this.newFunction(z));
return __return;
}
private newFunction(z: any) {
let a1 = { x: 1 };
y = 10;
z = 42;
this.b();
return { z, __return: a1.x + 10 };
}
}
}
@@ -1,85 +0,0 @@
==ORIGINAL==
namespace A {
let x = 1;
function foo() {
}
namespace B {
function a() {
let y = 5;
let z = x;
return foo();
}
}
}
==SCOPE::function a==
namespace A {
let x = 1;
function foo() {
}
namespace B {
function a() {
return newFunction();
function newFunction() {
let y = 5;
let z = x;
return foo();
}
}
}
}
==SCOPE::namespace B==
namespace A {
let x = 1;
function foo() {
}
namespace B {
function a() {
return newFunction();
}
function newFunction() {
let y = 5;
let z = x;
return foo();
}
}
}
==SCOPE::namespace A==
namespace A {
let x = 1;
function foo() {
}
namespace B {
function a() {
return newFunction();
}
}
function newFunction() {
let y = 5;
let z = x;
return foo();
}
}
==SCOPE::file '/a.ts'==
namespace A {
let x = 1;
function foo() {
}
namespace B {
function a() {
return newFunction(x, foo);
}
}
}
function newFunction(x: any, foo: any) {
let y = 5;
let z = x;
return foo();
}
@@ -1,80 +0,0 @@
==ORIGINAL==
namespace A {
function foo() {
}
namespace B {
function* a(z: number) {
let y = 5;
yield z;
return foo();
}
}
}
==SCOPE::function a==
namespace A {
function foo() {
}
namespace B {
function* a(z: number) {
return yield* newFunction();
function* newFunction() {
let y = 5;
yield z;
return foo();
}
}
}
}
==SCOPE::namespace B==
namespace A {
function foo() {
}
namespace B {
function* a(z: number) {
return yield* newFunction(z);
}
function* newFunction(z: any) {
let y = 5;
yield z;
return foo();
}
}
}
==SCOPE::namespace A==
namespace A {
function foo() {
}
namespace B {
function* a(z: number) {
return yield* newFunction(z);
}
}
function* newFunction(z: any) {
let y = 5;
yield z;
return foo();
}
}
==SCOPE::file '/a.ts'==
namespace A {
function foo() {
}
namespace B {
function* a(z: number) {
return yield* newFunction(z, foo);
}
}
}
function* newFunction(z: any, foo: any) {
let y = 5;
yield z;
return foo();
}
@@ -1,90 +0,0 @@
==ORIGINAL==
namespace A {
function foo() {
}
namespace B {
async function a(z: number, z1: any) {
let y = 5;
if (z) {
await z1;
}
return foo();
}
}
}
==SCOPE::function a==
namespace A {
function foo() {
}
namespace B {
async function a(z: number, z1: any) {
return await newFunction();
async function newFunction() {
let y = 5;
if (z) {
await z1;
}
return foo();
}
}
}
}
==SCOPE::namespace B==
namespace A {
function foo() {
}
namespace B {
async function a(z: number, z1: any) {
return await newFunction(z, z1);
}
async function newFunction(z: any, z1: any) {
let y = 5;
if (z) {
await z1;
}
return foo();
}
}
}
==SCOPE::namespace A==
namespace A {
function foo() {
}
namespace B {
async function a(z: number, z1: any) {
return await newFunction(z, z1);
}
}
async function newFunction(z: any, z1: any) {
let y = 5;
if (z) {
await z1;
}
return foo();
}
}
==SCOPE::file '/a.ts'==
namespace A {
function foo() {
}
namespace B {
async function a(z: number, z1: any) {
return await newFunction(z, z1, foo);
}
}
}
async function newFunction(z: any, z1: any, foo: any) {
let y = 5;
if (z) {
await z1;
}
return foo();
}
@@ -1,98 +0,0 @@
==ORIGINAL==
namespace A {
let x = 1;
export function foo() {
}
namespace B {
function a() {
let a = 1;
let y = 5;
let z = x;
a = y;
foo();
}
}
}
==SCOPE::function a==
namespace A {
let x = 1;
export function foo() {
}
namespace B {
function a() {
let a = 1;
newFunction();
function newFunction() {
let y = 5;
let z = x;
a = y;
foo();
}
}
}
}
==SCOPE::namespace B==
namespace A {
let x = 1;
export function foo() {
}
namespace B {
function a() {
let a = 1;
({ a } = newFunction(a));
}
function newFunction(a: any) {
let y = 5;
let z = x;
a = y;
foo();
return { a };
}
}
}
==SCOPE::namespace A==
namespace A {
let x = 1;
export function foo() {
}
namespace B {
function a() {
let a = 1;
({ a } = newFunction(a));
}
}
function newFunction(a: any) {
let y = 5;
let z = x;
a = y;
foo();
return { a };
}
}
==SCOPE::file '/a.ts'==
namespace A {
let x = 1;
export function foo() {
}
namespace B {
function a() {
let a = 1;
({ a } = newFunction(x, a));
}
}
}
function newFunction(x: any, a: any) {
let y = 5;
let z = x;
a = y;
A.foo();
return { a };
}
-101
View File
@@ -1,101 +0,0 @@
==ORIGINAL==
namespace A {
let x = 1;
export function foo() {
}
namespace B {
function a() {
let a = 1;
let y = 5;
let z = x;
a = y;
return foo();
}
}
}
==SCOPE::function a==
namespace A {
let x = 1;
export function foo() {
}
namespace B {
function a() {
let a = 1;
return newFunction();
function newFunction() {
let y = 5;
let z = x;
a = y;
return foo();
}
}
}
}
==SCOPE::namespace B==
namespace A {
let x = 1;
export function foo() {
}
namespace B {
function a() {
let a = 1;
var __return: any;
({ a, __return } = newFunction(a));
return __return;
}
function newFunction(a: any) {
let y = 5;
let z = x;
a = y;
return { a, __return: foo() };
}
}
}
==SCOPE::namespace A==
namespace A {
let x = 1;
export function foo() {
}
namespace B {
function a() {
let a = 1;
var __return: any;
({ a, __return } = newFunction(a));
return __return;
}
}
function newFunction(a: any) {
let y = 5;
let z = x;
a = y;
return { a, __return: foo() };
}
}
==SCOPE::file '/a.ts'==
namespace A {
let x = 1;
export function foo() {
}
namespace B {
function a() {
let a = 1;
var __return: any;
({ a, __return } = newFunction(x, a));
return __return;
}
}
}
function newFunction(x: any, a: any) {
let y = 5;
let z = x;
a = y;
return { a, __return: A.foo() };
}
-111
View File
@@ -1,111 +0,0 @@
==ORIGINAL==
namespace A {
let x = 1;
export namespace C {
export function foo() {
}
}
namespace B {
function a() {
let a = 1;
let y = 5;
let z = x;
a = y;
return C.foo();
}
}
}
==SCOPE::function a==
namespace A {
let x = 1;
export namespace C {
export function foo() {
}
}
namespace B {
function a() {
let a = 1;
return newFunction();
function newFunction() {
let y = 5;
let z = x;
a = y;
return C.foo();
}
}
}
}
==SCOPE::namespace B==
namespace A {
let x = 1;
export namespace C {
export function foo() {
}
}
namespace B {
function a() {
let a = 1;
var __return: any;
({ a, __return } = newFunction(a));
return __return;
}
function newFunction(a: any) {
let y = 5;
let z = x;
a = y;
return { a, __return: C.foo() };
}
}
}
==SCOPE::namespace A==
namespace A {
let x = 1;
export namespace C {
export function foo() {
}
}
namespace B {
function a() {
let a = 1;
var __return: any;
({ a, __return } = newFunction(a));
return __return;
}
}
function newFunction(a: any) {
let y = 5;
let z = x;
a = y;
return { a, __return: C.foo() };
}
}
==SCOPE::file '/a.ts'==
namespace A {
let x = 1;
export namespace C {
export function foo() {
}
}
namespace B {
function a() {
let a = 1;
var __return: any;
({ a, __return } = newFunction(x, a));
return __return;
}
}
}
function newFunction(x: any, a: any) {
let y = 5;
let z = x;
a = y;
return { a, __return: A.C.foo() };
}
@@ -1,57 +0,0 @@
==ORIGINAL==
namespace A {
let x = 1;
namespace B {
function a() {
let a1 = 1;
return 1 + a1 + x + 100;
}
}
}
==SCOPE::function a==
namespace A {
let x = 1;
namespace B {
function a() {
let a1 = 1;
return newFunction() + 100;
function newFunction() { 1 + a1 + x; }
}
}
}
==SCOPE::namespace B==
namespace A {
let x = 1;
namespace B {
function a() {
let a1 = 1;
return newFunction(a1) + 100;
}
function newFunction(a1: any) { 1 + a1 + x; }
}
}
==SCOPE::namespace A==
namespace A {
let x = 1;
namespace B {
function a() {
let a1 = 1;
return newFunction(a1) + 100;
}
}
function newFunction(a1: any) { 1 + a1 + x; }
}
==SCOPE::file '/a.ts'==
namespace A {
let x = 1;
namespace B {
function a() {
let a1 = 1;
return newFunction(a1, x) + 100;
}
}
}
function newFunction(a1: any, x: any) { 1 + a1 + x; }
@@ -1,65 +0,0 @@
==ORIGINAL==
namespace A {
export interface I { x: number };
namespace B {
function a() {
let a1: I = { x: 1 };
return a1.x + 10;
}
}
}
==SCOPE::function a==
namespace A {
export interface I { x: number };
namespace B {
function a() {
return newFunction();
function newFunction() {
let a1: I = { x: 1 };
return a1.x + 10;
}
}
}
}
==SCOPE::namespace B==
namespace A {
export interface I { x: number };
namespace B {
function a() {
return newFunction();
}
function newFunction() {
let a1: I = { x: 1 };
return a1.x + 10;
}
}
}
==SCOPE::namespace A==
namespace A {
export interface I { x: number };
namespace B {
function a() {
return newFunction();
}
}
function newFunction() {
let a1: I = { x: 1 };
return a1.x + 10;
}
}
==SCOPE::file '/a.ts'==
namespace A {
export interface I { x: number };
namespace B {
function a() {
return newFunction();
}
}
}
function newFunction() {
let a1: A.I = { x: 1 };
return a1.x + 10;
}