Skip to content

Safari needs a workaround for unary await expressions without parens #3505

@diagramatics

Description

@diagramatics

If you run if (!await test()) { return true } in Safari 10/11, it will throw you a parsing error, needing await test() to be wrapped in parentheses so the parser doesn't trip up. CC thinks the parens is unnecessary and strips it out though.

Here's a replication link to the CC UI.

This has been reported in Webkit fixed in later versions, documented and fixed in UglifyJS here and here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    internal-issue-createdAn internal Google issue has been created to track this GitHub issuetriage-doneHas been reviewed by someone on triage rotation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions