A receiver subscripting the enclosing class's object: `this. [k]` → `this. []`, `this['svc']` → `this.svc`; None for any other subscript. Mirrors tsThisSubscriptReceiver.
(&self, receiver: Node<'t>)
| 2340 | /// → `this.<field>[]`, `this['svc']` → `this.svc`; None for any other |
| 2341 | /// subscript. Mirrors tsThisSubscriptReceiver. |
| 2342 | fn this_subscript_of(&self, receiver: Node<'t>) -> Option<String> { |
| 2343 | if receiver.kind() != "subscript_expression" { |
| 2344 | return None; |
| 2345 | } |
| 2346 | let object = peel_receiver(receiver.child_by_field_name("object")?); |
| 2347 | if object.kind() == "this" { |
| 2348 | let key = self.quoted_identifier(receiver.child_by_field_name("index")?)?; |
| 2349 | return Some(format!("this.{key}")); |
| 2350 | } |
| 2351 | self.this_field_of(object).map(|field| format!("this.{field}[]")) |
| 2352 | } |
| 2353 | |
| 2354 | /// `await f<T>(x)` parses with `await f` as the callee (#2586), and a |
| 2355 | /// prefix operator over a generic call the same way |
no test coverage detected