Skip to content

Ternary conditional causes EOF errors in version 1.17 breaking backwards compatibility #772

Closed
@tarmo-randma

Description

@tarmo-randma

In the latest version (1.17) this script is failing in the playground (Probably related to #736):

let x = true ? "1" : "2";
x

It returns:

unexpected token EOF (2:2)
 | x
 | .^

In earlier versions this returned "1". The structure could be used for building conditional statements similar to the newly introduced if-else. While the newly introduces syntax is very welcome, perhaps it would be possible to restore support for the old format as well or make this a major version release instead of a minor one.

Moving from old syntax to new one will require considerable effort for larger codebases and it is hard to force customers to upgrade all their own code just because we want to update the library version.

Is this change deliberate or accidental? Perhaps I am missing something here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions