Skip to content

Function definition after the return statement #66

Closed
@eight04

Description

@eight04
  • Version: v11.10.0
  • Platform: Windows 7 x64
  1. Create foo.js:
    function test(foo = "foo") {
      return {bar};
      
      function bar() {
        console.log("test");
      }
    }
    
    test().bar();
  2. Run c8 --reporter html node foo.js
  3. Line 3, 4 are marked as uncovered:
    image

It works fine if test has no default argument:
image

c8 v3.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions