normalizeValue (function-ref.ts:525) for CSHARP_SPEC: bare identifiers, the transparent `argument` layer, and the `this.Member` special.
(&mut self, v: Node<'t>, from: u32, depth: u32)
| 1373 | /// normalizeValue (function-ref.ts:525) for CSHARP_SPEC: bare identifiers, |
| 1374 | /// the transparent `argument` layer, and the `this.Member` special. |
| 1375 | fn normalize_fn_ref_value(&mut self, v: Node<'t>, from: u32, depth: u32) { |
| 1376 | stack_guard!(); |
| 1377 | if depth > 4 { |
| 1378 | return; |
| 1379 | } |
| 1380 | match v.kind() { |
| 1381 | "identifier" => { |
| 1382 | let name = self.text(v); |
| 1383 | self.push_fn_ref_cand(from, name, v); |
| 1384 | } |
| 1385 | "argument" => { |
| 1386 | // Transparent layer (field=null) → recurse all named children. |
| 1387 | for i in 0..v.named_child_count() { |
| 1388 | if let Some(c) = v.named_child(i) { |
| 1389 | self.normalize_fn_ref_value(c, from, depth + 1); |
| 1390 | } |
| 1391 | } |
| 1392 | } |
| 1393 | "member_access_expression" => { |
| 1394 | // `this.Run0` — receiver must be EXACTLY `this` (the vendored |
| 1395 | // grammar yields the anonymous `this` token via the field; |
| 1396 | // text-prefix fallback for field-less shapes). Candidate is |
| 1397 | // the BARE member name at the name node's position. |
| 1398 | let Some(name_node) = v.child_by_field_name("name") else { return }; |
| 1399 | let is_this = match v.child_by_field_name("expression") { |
| 1400 | Some(e) => e.kind() == "this_expression" || e.kind() == "this", |
| 1401 | None => self.text(v).starts_with("this."), |
| 1402 | }; |
| 1403 | if is_this { |
| 1404 | let name = self.text(name_node); |
| 1405 | self.push_fn_ref_cand(from, name, name_node); |
| 1406 | } |
| 1407 | } |
| 1408 | _ => {} |
| 1409 | } |
| 1410 | } |
| 1411 | |
| 1412 | fn push_fn_ref_cand(&mut self, from: u32, name: &str, node: Node) { |
| 1413 | if name.is_empty() || is_stoplisted(name) { |
no test coverage detected