function.js 577 B

1234567891011121314151617181920212223242526272829
  1. module.exports = class CovFunction {
  2. constructor (name, startLine, startCol, endLine, endCol, count) {
  3. this.name = name
  4. this.startLine = startLine
  5. this.startCol = startCol
  6. this.endLine = endLine
  7. this.endCol = endCol
  8. this.count = count
  9. }
  10. toIstanbul () {
  11. const loc = {
  12. start: {
  13. line: this.startLine,
  14. column: this.startCol
  15. },
  16. end: {
  17. line: this.endLine,
  18. column: this.endCol
  19. }
  20. }
  21. return {
  22. name: this.name,
  23. decl: loc,
  24. loc: loc,
  25. line: this.startLine
  26. }
  27. }
  28. }