Skip to content

Crash when both use "@babel/plugin-proposal-object-rest-spread" & "@babel/plugin-transform-block-scoping" with TDZ is true #9394

@uni-zheng

Description

@uni-zheng

Bug Report

Current Behavior
Compiler throw error: Property id of VariableDeclarator expected node to be of a type ["LVal"] but instead got "CallExpression

Input Code

let { bar, foo } = { foo: "aaa", bar: "bbb" };

Expected behavior/code
Working

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

{
  "presets": [
    ["@babel/preset-env", {
      "ignoreBrowserslistConfig": true
    }]
  ],
  "plugins": [
    ["@babel/plugin-proposal-object-rest-spread"],
    ["@babel/plugin-transform-block-scoping", {
      "tdz": true
    }]
  ]
}

Environment

  • Babel version(s): @babel/core v7.2.2
  • Node/npm version: Node 10.14.2/npm 6.4.1
  • OS: OSX 10.14.2
  • Monorepo: no
  • How you are using Babel: cli 7.2.3

Possible Solution

Additional context/Screenshots
It's working If remove tdz config.

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Has PRoutdatedA 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