(node: t.Node)
| 258 | |
| 259 | let fileNameIdentifier: Identifier | undefined; |
| 260 | function makeSource(node: t.Node) { |
| 261 | const location = node.loc; |
| 262 | if (!location) { |
| 263 | // the element was generated and doesn't have location information |
| 264 | return t.buildUndefinedNode(); |
| 265 | } |
| 266 | |
| 267 | if (!fileNameIdentifier) { |
| 268 | fileNameIdentifier = |
| 269 | path.scope.generateUidIdentifier("_jsxFileName"); |
| 270 | } |
| 271 | |
| 272 | return makeTrace( |
| 273 | t.cloneNode(fileNameIdentifier), |
| 274 | location.start.line, |
| 275 | location.start.column, |
| 276 | ); |
| 277 | } |
| 278 | |
| 279 | function makeTrace( |
| 280 | fileNameIdentifier: Identifier, |
no test coverage detected