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

Method this_field_of

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

1920
1921 /// `this.<field>` as a member_expression receiver → Some(field) (#1496, #1987).
1922 fn this_field_of(&self, receiver: Node<'t>) -> Option<String> {
1923 if receiver.kind() != "member_expression" {
1924 return None;
1925 }
1926 let object = receiver.child_by_field_name("object")?;
1927 let property = receiver.child_by_field_name("property")?;
1928 // An ES private field (`this.#items`) keeps its `#` (#1987).
1929 if object.kind() != "this"
1930 || !matches!(property.kind(), "property_identifier" | "private_property_identifier")
1931 {
1932 return None;
1933 }
1934 Some(self.text(property).to_string())
1935 }
1936
1937 /// A receiver subscripting the enclosing class's object: `this.<field>[k]`
1938 /// → `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