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

     1  export {}
     2  
     3  //- @shortProperty defines/binding ShortPropertyVariable
     4  const shortProperty = 0;
     5  
     6  //- @#0"computed" defines/binding Computed
     7  const computed = 'computed';
     8  
     9  const Object = {
    10    //- @property defines/binding Property
    11    //- Property.node/kind variable
    12    //- Property.subkind field
    13    property: 3,
    14  
    15    //- @shortProperty defines/binding ShortProperty
    16    //- ShortProperty.node/kind variable
    17    //- ShortProperty.subkind field
    18    //- @shortProperty ref/id ShortPropertyVariable
    19    shortProperty,
    20  
    21    //- !{@"[computed]" defines/binding _}
    22    //- @computed ref Computed
    23    [computed]: 0,
    24  
    25    //- @method defines/binding Method
    26    //- Method.node/kind function
    27    method() {},
    28  
    29    //- @"'string#literal'" defines/binding SLiteralProperty
    30    //- SLiteralProperty.node/kind variable
    31    'string#literal': 0,
    32  
    33    //- @"123" defines/binding NLiteralProperty
    34    //- NLiteralProperty.node/kind variable
    35    //- NLiteralProperty.subkind field
    36    123: 'nliteral',
    37  };
    38  
    39  //- @property ref Property
    40  //- @shortProperty ref ShortProperty
    41  const x = Object.property || Object.shortProperty;
    42  
    43  //- @computed ref Computed
    44  Object[computed];
    45  
    46  //- @"'string#literal'" ref SLiteralProperty
    47  Object['string#literal'];
    48  
    49  //- @"123" ref NLiteralProperty
    50  Object[123];
    51  
    52  //- @method ref Method
    53  Object.method();