Skip to content

Comments in parentheses disappear #11576

@jleveugle

Description

@jleveugle

Bug Report

  • I would like to work on a fix!

Current Behavior

Comments in parentheses disappear when compiled.

Example here:

https://babeljs.io/repl#?browsers=defaults%2C%20not%20ie%2011%2C%20not%20ie_mob%2011&build=&builtIns=false&spec=false&loose=false&code_lz=GYexHoCoAIHUHkBKBpAkgOQOLUuAFFNOvACpxJpY7gCUQA&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=false&fileSize=false&timeTravel=false&sourceType=module&lineWrap=true&presets=env%2Creact%2Cstage-2%2Cenv&prettier=false&targets=&version=7.9.6&externalPlugins=

Input Code

foo/* WORKING */(/* NOT WORKING */)

Current result:

"use strict";

foo
/* WORKING */
();

Expected behavior/code

The comment in parentheses should be here after transpilation.

"use strict";

foo
/* WORKING */
(
/* NOT WORKING */
);

I use the default configuration to reproduce this issue. Of course, shouldPrintComment has no effect on that. The issue seems to be before the function provided by shouldPrintComment.

Environment

  System:
    OS: macOS Mojave 10.14.6
  Binaries:
    Node: 13.8.0 - ~/bin/brew/bin/node
    Yarn: 1.22.0 - ~/bin/brew/bin/yarn
    npm: 6.13.7 - ~/bin/brew/bin/npm

Do you agree that this behavior is not the expected one ?

Thanks for your help !

Metadata

Metadata

Assignees

No one assigned

    Labels

    i: needs triageoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions