kythe.io@v0.0.68-0.20240422202219-7225dbc01741/kythe/typescript/testdata/scope.ts (about)

     1  export {}
     2  
     3  //- @x defines/binding X
     4  let x = 3;
     5  
     6  //- @y defines/binding AY
     7  function a(y) {
     8    //- @x defines/binding AX
     9    let x = 3;
    10    {
    11      //- @x defines/binding AX2
    12      let x = 3;
    13      //- @x ref AX2
    14      //- !{@x ref X}
    15      //- !{@x ref AX}
    16      x;
    17    }
    18    {
    19      //- @x defines/binding AX3
    20      let x = 3;
    21      //- @y defines/binding AY2
    22      let y = 3;
    23      //- @x ref AX3
    24      //- !{@x ref AX2}
    25      x;
    26    }
    27    //- @x ref AX
    28    x;
    29    //- @y ref AY
    30    //- !{@y ref AY2}
    31    y;
    32  }
    33  
    34  // This x refers to the outer scope's x.
    35  //- @x ref X
    36  x;