Skip to content
This repository was archived by the owner on May 19, 2018. It is now read-only.
/ babylon Public archive
This repository was archived by the owner on May 19, 2018. It is now read-only.

6.17.2 release breaks /* istanbul ignore */ comments in some scenarios #574

@bcoe

Description

@bcoe

this change introduced in babylon@6.17.2 seems to break Istanbul's ignore next functionality in some situations. See the following code:

Input Code

'use strict'

const test = foo => {
  switch (foo) {
    case 'ok':
      return console.log('this is fine')

    /* istanbul ignore next */
    default:
      throw new Error('nope')
  }
}

test('ok')

Expected Behavior

the comment /* istanbul ignore next */ ignores the default statement (behavior in 6.17.1).

Current Behavior

the comment /* isanbul ignore next */ fails to ignore the default switch statement (behavior in 6.17.2).

Thoughts

I believe the issue is that the comment gets folded up onto the prior line, and then we fail to traverse to the default statement when deciding what to ignore.

CC: @aardito2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions