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.

Ternary expression fails parsing when react preset is present #429

@babel-bot

Description

@babel-bot

Original issue submitted by @adrianton3 in babel/babel#5529

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions