MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / this_field_of

Method this_field_of

codegraph-kernel/src/tsjs/extractors.rs:2324–2337  ·  view source on GitHub ↗

`this. ` as a member_expression receiver → Some(field) (#1496, #1987).

(&self, receiver: Node<'t>)

Source from the content-addressed store, hash-verified

2322
2323 /// `this.<field>` as a member_expression receiver → Some(field) (#1496, #1987).
2324 fn this_field_of(&self, receiver: Node<'t>) -> Option<String> {
2325 if receiver.kind() != "member_expression" {
2326 return None;
2327 }
2328 let object = receiver.child_by_field_name("object")?;
2329 let property = receiver.child_by_field_name("property")?;
2330 // An ES private field (`this.#items`) keeps its `#` (#1987).
2331 if object.kind() != "this"
2332 || !matches!(property.kind(), "property_identifier" | "private_property_identifier")
2333 {
2334 return None;
2335 }
2336 Some(self.text(property).to_string())
2337 }
2338
2339 /// A receiver subscripting the enclosing class's object: `this.<field>[k]`
2340 /// → `this.<field>[]`, `this['svc']` → `this.svc`; None for any other

Callers 2

extract_callMethod · 0.80
this_subscript_ofMethod · 0.80

Calls 1

textMethod · 0.65

Tested by

no test coverage detected