protocolbuffers / protobuf-javascript

BSD 3-Clause "New" or "Revised" License
348 stars 66 forks source link

JS compiler: List of keywords incorrect #56

Open DXsmiley opened 5 years ago

DXsmiley commented 5 years ago

The JS compiler's list of keywords, kKeyword, is actually a list of Java keywords. (it's missing async, await, has transient when it shouldn't, etc.)

Relevant code: https://github.com/protocolbuffers/protobuf/blob/94a1819c7ae8509ab6ad37d867d3ea60a5809aaa/src/google/protobuf/compiler/js/js_generator.cc#L62-L68

TeBoring commented 5 years ago

Could you help send a fix?

DpEpsilon commented 5 years ago

So I did some research, and it turns out ES1-3 reserves the extra keywords on that list, so it's not just a list of Java keywords. However, the list does exclude true, as well as newer keywords (and typescript keywords).

dibenede commented 1 year ago

We should tidy up the list -- adding await makes sense.