normalizeValue for the TS/JS spec: bare identifiers, plus the `this. ` member_expression special form (object EXACTLY `this`).
(node: Node<'t>, src: &str)
| 116 | /// normalizeValue for the TS/JS spec: bare identifiers, plus the |
| 117 | /// `this.<member>` member_expression special form (object EXACTLY `this`). |
| 118 | fn normalize<'t>(node: Node<'t>, src: &str) -> Vec<(String, Node<'t>)> { |
| 119 | match node.kind() { |
| 120 | "identifier" => vec![(src[node.byte_range()].to_string(), node)], |
| 121 | "member_expression" => { |
| 122 | let obj = node.child_by_field_name("object"); |
| 123 | let prop = node.child_by_field_name("property"); |
| 124 | if let (Some(o), Some(p)) = (obj, prop) { |
| 125 | if o.kind() == "this" && p.kind() == "property_identifier" { |
| 126 | return vec![(format!("this.{}", &src[p.byte_range()]), p)]; |
| 127 | } |
| 128 | } |
| 129 | vec![] |
| 130 | } |
| 131 | _ => vec![], |
| 132 | } |
| 133 | } |
no outgoing calls
no test coverage detected