matthewrobb / six

JavaScript you can bet on. [WARNING]: Progress has been suspended on this project most likely indefinitely
MIT License
227 stars 9 forks source link

ES5 'set' throws error. #72

Open Synvox opened 11 years ago

Synvox commented 11 years ago

I tried the following in both the online repl and locally though npm.

class Blah {
  get a(){
    alert('getting a');
  }
  set a(){
    alert('setting a');
  }
}

Line 5: Unexpected token )

and...

class Blah {
  get a(){
    alert('getting a');
  }
  set b(){
    alert('setting b');
  }
}

Line 5: Unexpected token )

matthewrobb commented 11 years ago

Thank you for reporting this, I will look in to it and have a fix in as soon as I track down the issue (I have a few ideas where it might be)

Synvox commented 11 years ago

Ok. Thank a lot. The same happens with:

a={
  set a:function(){}
}

and

a={
  get a:function(){}
}
matthewrobb commented 11 years ago

neither of those last two examples are valid ES5

a={
  [g|s]et a(){  }
}
Synvox commented 11 years ago

Woah. My bad. Forget that comment was posted.