butternut icon indicating copy to clipboard operation
butternut copied to clipboard

Object within a function breaks

Open bdc-stripe opened this issue 8 years ago • 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.

bdc-stripe avatar Oct 25 '17 11:10 bdc-stripe

Workaround: it looks like this equivalent succeeds:

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

christophercurrie avatar Jul 02 '18 22:07 christophercurrie