Skip to content

Commit

Permalink
Updated baseline. And added more tests.
Browse files Browse the repository at this point in the history
Signed-off-by: Titian Cernicova-Dragomir <tcernicovad1@bloomberg.net>
  • Loading branch information
dragomirtitian committed Nov 27, 2023
1 parent a8c29dc commit c0d6726
Show file tree
Hide file tree
Showing 41 changed files with 2,892 additions and 201 deletions.
117 changes: 117 additions & 0 deletions tests/baselines/reference/expandoFunctionNestedAssigments.js
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;
}
125 changes: 125 additions & 0 deletions tests/baselines/reference/expandoFunctionNestedAssigments.symbols
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
//// [tests/cases/compiler/expandoFunctionNestedAssigments.ts] ////

=== expandoFunctionNestedAssigments.ts ===
function Foo(): void {
>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more)

}

(Foo.bla = { foo: 1}).foo = (Foo.baz = 1) + (Foo.bar = 0);
>(Foo.bla = { foo: 1}).foo : Symbol(foo, Decl(expandoFunctionNestedAssigments.ts, 4, 12))
>Foo.bla : Symbol(Foo.bla, Decl(expandoFunctionNestedAssigments.ts, 4, 1))
>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more)
>bla : Symbol(Foo.bla, Decl(expandoFunctionNestedAssigments.ts, 4, 1))
>foo : Symbol(foo, Decl(expandoFunctionNestedAssigments.ts, 4, 12))
>foo : Symbol(foo, Decl(expandoFunctionNestedAssigments.ts, 4, 12))
>Foo.baz : Symbol(Foo.baz, Decl(expandoFunctionNestedAssigments.ts, 4, 29))
>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more)
>baz : Symbol(Foo.baz, Decl(expandoFunctionNestedAssigments.ts, 4, 29))
>Foo.bar : Symbol(Foo.bar, Decl(expandoFunctionNestedAssigments.ts, 4, 45))
>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more)
>bar : Symbol(Foo.bar, Decl(expandoFunctionNestedAssigments.ts, 4, 45))

if(Foo.fromIf = 1) {
>Foo.fromIf : Symbol(Foo.fromIf, Decl(expandoFunctionNestedAssigments.ts, 6, 3))
>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more)
>fromIf : Symbol(Foo.fromIf, Decl(expandoFunctionNestedAssigments.ts, 6, 3))

Foo.inIf = 1;
>Foo.inIf : Symbol(Foo.inIf, Decl(expandoFunctionNestedAssigments.ts, 6, 20))
>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more)
>inIf : Symbol(Foo.inIf, Decl(expandoFunctionNestedAssigments.ts, 6, 20))
}

while(Foo.fromWhileCondition = 1) {
>Foo.fromWhileCondition : Symbol(Foo.fromWhileCondition, Decl(expandoFunctionNestedAssigments.ts, 10, 6))
>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more)
>fromWhileCondition : Symbol(Foo.fromWhileCondition, Decl(expandoFunctionNestedAssigments.ts, 10, 6))

Foo.fromWhileBody = 1;
>Foo.fromWhileBody : Symbol(Foo.fromWhileBody, Decl(expandoFunctionNestedAssigments.ts, 10, 35))
>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more)
>fromWhileBody : Symbol(Foo.fromWhileBody, Decl(expandoFunctionNestedAssigments.ts, 10, 35))
{
Foo.fromWhileBodyNested = 1;
>Foo.fromWhileBodyNested : Symbol(Foo.fromWhileBodyNested, Decl(expandoFunctionNestedAssigments.ts, 12, 5))
>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more)
>fromWhileBodyNested : Symbol(Foo.fromWhileBodyNested, Decl(expandoFunctionNestedAssigments.ts, 12, 5))
}
}

do {
Foo.fromDoBody = 1;
>Foo.fromDoBody : Symbol(Foo.fromDoBody, Decl(expandoFunctionNestedAssigments.ts, 17, 4))
>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more)
>fromDoBody : Symbol(Foo.fromDoBody, Decl(expandoFunctionNestedAssigments.ts, 17, 4))
{
Foo.fromDoBodyNested = 1;
>Foo.fromDoBodyNested : Symbol(Foo.fromDoBodyNested, Decl(expandoFunctionNestedAssigments.ts, 19, 5))
>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more)
>fromDoBodyNested : Symbol(Foo.fromDoBodyNested, Decl(expandoFunctionNestedAssigments.ts, 19, 5))
}
} while(Foo.fromDoCondition = 1);
>Foo.fromDoCondition : Symbol(Foo.fromDoCondition, Decl(expandoFunctionNestedAssigments.ts, 22, 8))
>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more)
>fromDoCondition : Symbol(Foo.fromDoCondition, Decl(expandoFunctionNestedAssigments.ts, 22, 8))

for(Foo.forInit = 1; (Foo.forCond = 1) > 1; Foo.forIncr = 1){
>Foo.forInit : Symbol(Foo.forInit, Decl(expandoFunctionNestedAssigments.ts, 24, 4))
>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more)
>forInit : Symbol(Foo.forInit, Decl(expandoFunctionNestedAssigments.ts, 24, 4))
>Foo.forCond : Symbol(Foo.forCond, Decl(expandoFunctionNestedAssigments.ts, 24, 22))
>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more)
>forCond : Symbol(Foo.forCond, Decl(expandoFunctionNestedAssigments.ts, 24, 22))
>Foo.forIncr : Symbol(Foo.forIncr, Decl(expandoFunctionNestedAssigments.ts, 24, 43))
>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more)
>forIncr : Symbol(Foo.forIncr, Decl(expandoFunctionNestedAssigments.ts, 24, 43))

Foo.fromForBody = 1;
>Foo.fromForBody : Symbol(Foo.fromForBody, Decl(expandoFunctionNestedAssigments.ts, 24, 61))
>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more)
>fromForBody : Symbol(Foo.fromForBody, Decl(expandoFunctionNestedAssigments.ts, 24, 61))
{
Foo.fromForBodyNested = 1;
>Foo.fromForBodyNested : Symbol(Foo.fromForBodyNested, Decl(expandoFunctionNestedAssigments.ts, 26, 5))
>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more)
>fromForBodyNested : Symbol(Foo.fromForBodyNested, Decl(expandoFunctionNestedAssigments.ts, 26, 5))
}
}

for(let f of (Foo.forOf = []) ){
>f : Symbol(f, Decl(expandoFunctionNestedAssigments.ts, 31, 7))
>Foo.forOf : Symbol(Foo.forOf, Decl(expandoFunctionNestedAssigments.ts, 31, 14))
>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more)
>forOf : Symbol(Foo.forOf, Decl(expandoFunctionNestedAssigments.ts, 31, 14))

Foo.fromForOfBody = 1;
>Foo.fromForOfBody : Symbol(Foo.fromForOfBody, Decl(expandoFunctionNestedAssigments.ts, 31, 32))
>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more)
>fromForOfBody : Symbol(Foo.fromForOfBody, Decl(expandoFunctionNestedAssigments.ts, 31, 32))
{
Foo.fromForOfBodyNested = 1;
>Foo.fromForOfBodyNested : Symbol(Foo.fromForOfBodyNested, Decl(expandoFunctionNestedAssigments.ts, 33, 5))
>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more)
>fromForOfBodyNested : Symbol(Foo.fromForOfBodyNested, Decl(expandoFunctionNestedAssigments.ts, 33, 5))
}
}


for(let f in (Foo.forIn = []) ){
>f : Symbol(f, Decl(expandoFunctionNestedAssigments.ts, 39, 7))
>Foo.forIn : Symbol(Foo.forIn, Decl(expandoFunctionNestedAssigments.ts, 39, 14))
>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more)
>forIn : Symbol(Foo.forIn, Decl(expandoFunctionNestedAssigments.ts, 39, 14))

Foo.fromForInBody = 1;
>Foo.fromForInBody : Symbol(Foo.fromForInBody, Decl(expandoFunctionNestedAssigments.ts, 39, 32))
>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more)
>fromForInBody : Symbol(Foo.fromForInBody, Decl(expandoFunctionNestedAssigments.ts, 39, 32))
{
Foo.fromForInBodyNested = 1;
>Foo.fromForInBodyNested : Symbol(Foo.fromForInBodyNested, Decl(expandoFunctionNestedAssigments.ts, 41, 5))
>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more)
>fromForInBodyNested : Symbol(Foo.fromForInBodyNested, Decl(expandoFunctionNestedAssigments.ts, 41, 5))
}
}
Loading

0 comments on commit c0d6726

Please sign in to comment.