(
body: babel.types.BlockStatement,
node: t.Node,
)
| 278 | ) as (...args: Parameters<ReturnType<typeof babel.template>>) => t.Statement |
| 279 | |
| 280 | function addLocationToBody( |
| 281 | body: babel.types.BlockStatement, |
| 282 | node: t.Node, |
| 283 | ) { |
| 284 | let location = getNodeLocationAttribute(node, file_filename) |
| 285 | if (location) { |
| 286 | |
| 287 | if (!file_imported) { |
| 288 | file_imported = true |
| 289 | |
| 290 | file_program!.unshiftContainer('body', [ |
| 291 | t.importDeclaration( |
| 292 | [t.importSpecifier(sdt_get_owner_ident, get_owner_ident)], |
| 293 | solid_js_str, |
| 294 | ), |
| 295 | ]) |
| 296 | } |
| 297 | |
| 298 | body.body.unshift(buildSetComponentLocationAst({loc: t.stringLiteral(location)})) |
| 299 | } |
| 300 | } |
| 301 | |
| 302 | return { |
| 303 | name: '@solid-devtools/location', |
no test coverage detected
searching dependent graphs…