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

Method this_field_of

codegraph-kernel/src/tsjs/extractors.rs:1784–1797  ·  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

1782
1783 /// `this.<field>` as a member_expression receiver → Some(field) (#1496, #1987).
1784 fn this_field_of(&self, receiver: Node<'t>) -> Option<String> {
1785 if receiver.kind() != "member_expression" {
1786 return None;
1787 }
1788 let object = receiver.child_by_field_name("object")?;
1789 let property = receiver.child_by_field_name("property")?;
1790 // An ES private field (`this.#items`) keeps its `#` (#1987).
1791 if object.kind() != "this"
1792 || !matches!(property.kind(), "property_identifier" | "private_property_identifier")
1793 {
1794 return None;
1795 }
1796 Some(self.text(property).to_string())
1797 }
1798
1799 /// A receiver subscripting the enclosing class's object: `this.<field>[k]`
1800 /// → `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