Skip to content

Ternary expression fails parsing when react preset is present #5529

@adrianton3

Description

@adrianton3

Input Code

a ? () => ({}) : b => c

repl link

Babel Configuration (.babelrc, package.json, cli command)

See the link to the repl

Expected Behavior

The code should compile to

a ? function () {
  return {};
} : function (b) {
  return c;
};

as it does if the react preset is not mentioned

Current Behavior

repl: Unexpected token, expected : (1:23)
> 1 | a ? () => ({}) : b => c
    |                        ^

Your Environment

Getting this in the online repl; the latest release as of 23 mar 2017 is 6.24.0 assuming the repl is using that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: upstreamoutdatedA 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