Skip to content

[Bug]: Babel throws on computed property access using[x] #15221

@JLHwung

Description

@JLHwung

💻

  • Would you like to work on a fix?

How are you using Babel?

Programmatic API (babel.transform, babel.parse)

Input code

var using = [];
using[0];

REPL

Configuration file name

No response

Configuration

REPL

Current and expected behavior

Current: Babel throws "Support for the experimental syntax 'explicitResourceManagement' isn't currently enabled (2:1)"

Expected: Babel parses it successfully.

Environment

REPL

Possible solution

No response

Additional context

This is a regression introduced in #14968.

The bug is already covered in the test case

but the behaviour is not correct since it is already valid JS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    i: regressionoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issuepkg: parser

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions