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

Method this_field_of

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

1935
1936 /// `this.<field>` as a member_expression receiver → Some(field) (#1496, #1987).
1937 fn this_field_of(&self, receiver: Node<'t>) -> Option<String> {
1938 if receiver.kind() != "member_expression" {
1939 return None;
1940 }
1941 let object = receiver.child_by_field_name("object")?;
1942 let property = receiver.child_by_field_name("property")?;
1943 // An ES private field (`this.#items`) keeps its `#` (#1987).
1944 if object.kind() != "this"
1945 || !matches!(property.kind(), "property_identifier" | "private_property_identifier")
1946 {
1947 return None;
1948 }
1949 Some(self.text(property).to_string())
1950 }
1951
1952 /// A receiver subscripting the enclosing class's object: `this.<field>[k]`
1953 /// → `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