forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 15
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 #120 from bloomberg/isolated-declarations-expando-…
…functions Isolated declarations expando functions
- Loading branch information
Showing
45 changed files
with
3,242 additions
and
485 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
117 changes: 117 additions & 0 deletions
117
tests/baselines/reference/expandoFunctionNestedAssigments.js
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,117 @@ | ||
//// [tests/cases/compiler/expandoFunctionNestedAssigments.ts] //// | ||
|
||
//// [expandoFunctionNestedAssigments.ts] | ||
function Foo(): void { | ||
|
||
} | ||
|
||
(Foo.bla = { foo: 1}).foo = (Foo.baz = 1) + (Foo.bar = 0); | ||
|
||
if(Foo.fromIf = 1) { | ||
Foo.inIf = 1; | ||
} | ||
|
||
while(Foo.fromWhileCondition = 1) { | ||
Foo.fromWhileBody = 1; | ||
{ | ||
Foo.fromWhileBodyNested = 1; | ||
} | ||
} | ||
|
||
do { | ||
Foo.fromDoBody = 1; | ||
{ | ||
Foo.fromDoBodyNested = 1; | ||
} | ||
} while(Foo.fromDoCondition = 1); | ||
|
||
for(Foo.forInit = 1; (Foo.forCond = 1) > 1; Foo.forIncr = 1){ | ||
Foo.fromForBody = 1; | ||
{ | ||
Foo.fromForBodyNested = 1; | ||
} | ||
} | ||
|
||
for(let f of (Foo.forOf = []) ){ | ||
Foo.fromForOfBody = 1; | ||
{ | ||
Foo.fromForOfBodyNested = 1; | ||
} | ||
} | ||
|
||
|
||
for(let f in (Foo.forIn = []) ){ | ||
Foo.fromForInBody = 1; | ||
{ | ||
Foo.fromForInBodyNested = 1; | ||
} | ||
} | ||
|
||
//// [expandoFunctionNestedAssigments.js] | ||
function Foo() { | ||
} | ||
(Foo.bla = { foo: 1 }).foo = (Foo.baz = 1) + (Foo.bar = 0); | ||
if (Foo.fromIf = 1) { | ||
Foo.inIf = 1; | ||
} | ||
while (Foo.fromWhileCondition = 1) { | ||
Foo.fromWhileBody = 1; | ||
{ | ||
Foo.fromWhileBodyNested = 1; | ||
} | ||
} | ||
do { | ||
Foo.fromDoBody = 1; | ||
{ | ||
Foo.fromDoBodyNested = 1; | ||
} | ||
} while (Foo.fromDoCondition = 1); | ||
for (Foo.forInit = 1; (Foo.forCond = 1) > 1; Foo.forIncr = 1) { | ||
Foo.fromForBody = 1; | ||
{ | ||
Foo.fromForBodyNested = 1; | ||
} | ||
} | ||
for (var _i = 0, _a = (Foo.forOf = []); _i < _a.length; _i++) { | ||
var f = _a[_i]; | ||
Foo.fromForOfBody = 1; | ||
{ | ||
Foo.fromForOfBodyNested = 1; | ||
} | ||
} | ||
for (var f in (Foo.forIn = [])) { | ||
Foo.fromForInBody = 1; | ||
{ | ||
Foo.fromForInBodyNested = 1; | ||
} | ||
} | ||
|
||
|
||
//// [expandoFunctionNestedAssigments.d.ts] | ||
declare function Foo(): void; | ||
declare namespace Foo { | ||
var bla: { | ||
foo: number; | ||
}; | ||
var baz: number; | ||
var bar: number; | ||
var fromIf: number; | ||
var inIf: number; | ||
var fromWhileCondition: number; | ||
var fromWhileBody: number; | ||
var fromWhileBodyNested: number; | ||
var fromDoBody: number; | ||
var fromDoBodyNested: number; | ||
var fromDoCondition: number; | ||
var forInit: number; | ||
var forCond: number; | ||
var fromForBody: number; | ||
var fromForBodyNested: number; | ||
var forIncr: number; | ||
var forOf: any[]; | ||
var fromForOfBody: number; | ||
var fromForOfBodyNested: number; | ||
var forIn: any[]; | ||
var fromForInBody: number; | ||
var fromForInBodyNested: number; | ||
} |
Oops, something went wrong.