Skip to content

Incorrect behaviour with array destructuring #151

@dsblv

Description

@dsblv

Babili seems to be misinterpreting array destructuring inside function bodies:

Input

const me = lyfe => {
  const [swag] = lyfe;
  return swag;
}

Output

const me=a=>{return a};

REPL

As you can see, it acts as if there's no destructuring going on at all.

It fails if you try to get more than one item:

Input

const me = lyfe => {
  const [swag, yolo] = lyfe;

  return swag && yolo;
}

Error message

repl: NodePath has been removed so is read-only. (This is an error on an internal node. Probably an internal error)

REPL

On the other hand, destructuring outside functions seems to be fine. Object destructuring also worked for me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions