(source)
| 288 | } |
| 289 | |
| 290 | process(source) { |
| 291 | let self = this; |
| 292 | |
| 293 | let varIndex = 0; |
| 294 | |
| 295 | // First pass to collect dependency information. |
| 296 | babelTraverse(source.ast, { |
| 297 | Super(path) { |
| 298 | while (path) { |
| 299 | path.node.__needsSuper = true; |
| 300 | path = path.parentPath; |
| 301 | } |
| 302 | }, |
| 303 | |
| 304 | YieldExpression(path) { |
| 305 | // Don't include yield expressions in DB. |
| 306 | _markSkipped(path); |
| 307 | }, |
| 308 | |
| 309 | Identifier(path) { |
| 310 | if (globalIdentifiers.has(path.node.name) && |
| 311 | path.node.name != 'eval') { |
| 312 | // Global name. |
| 313 | return; |
| 314 | } |
| 315 | |
| 316 | if (propertyNames.has(path.node.name) && |
| 317 | path.parentPath.isMemberExpression() && |
| 318 | path.parentKey !== 'object') { |
| 319 | // Builtin property name. |
| 320 | return; |
| 321 | } |
| 322 | |
| 323 | if (path.parentPath.isMemberExpression() && |
| 324 | path.parent.property == path.node && |
| 325 | babelTypes.isIdentifier(path.parent.object) && |
| 326 | globalIdentifiers.has(path.parent.object.name)) { |
| 327 | // Property access on a global name. |
| 328 | return; |
| 329 | } |
| 330 | |
| 331 | let binding = path.scope.getBinding(path.node.name); |
| 332 | if (!binding) { |
| 333 | // Unknown dependency. Don't handle this. |
| 334 | _markSkipped(path); |
| 335 | return; |
| 336 | } |
| 337 | |
| 338 | let newName; |
| 339 | if (path.node.name.startsWith('VAR_')) { |
| 340 | newName = path.node.name; |
| 341 | } else if (babelTypes.isFunctionDeclaration(binding.path.node) || |
| 342 | babelTypes.isFunctionExpression(binding.path.node) || |
| 343 | babelTypes.isDeclaration(binding.path.node) || |
| 344 | babelTypes.isFunctionExpression(binding.path.node)) { |
| 345 | // Unknown dependency. Don't handle this. |
| 346 | _markSkipped(path); |
| 347 | return; |
no outgoing calls
no test coverage detected