Rich-Harris/butternut

Object within a function breaks

bdc-stripe opened this issue · 1 comments

The following code throws an error:

let fn = () => {
  let object = {
    foo: 1,
    bar: 2
  }
}

Oddly enough, it works if the object has only one property, or if it's not in a function.

Workaround: it looks like this equivalent succeeds:

let fn = () => {
  let obj = ({
    foo: 1,
    bar: 2
  });
}