atom / language-javascript

JavaScript language package for Atom
Other
194 stars 235 forks source link

Recognize numeric literals in ES6 method definitions #410

Open Zirro opened 8 years ago

Zirro commented 8 years ago

These keys are valid but marked as "invalid illegal" with the current regex:

const obj = {
  0() {},
  0b101() {},
  010() {},
  80() {},
  .12e3() {},
  0o753() {},
  12e34() {},
  0xFFFF() {},
};

I came across the first one in my own code, which prompted me to look up the other potential ones here: https://mathiasbynens.be/notes/javascript-properties

Alhadis commented 8 years ago

I'll fix this once #408 gets merged upstream.