protobuf-javascript icon indicating copy to clipboard operation
protobuf-javascript copied to clipboard

JS compiler: List of keywords incorrect

Open DXsmiley opened this issue 6 years ago • 3 comments

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

DXsmiley avatar Feb 11 '19 00:02 DXsmiley

Could you help send a fix?

TeBoring avatar Feb 11 '19 18:02 TeBoring

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).

DpEpsilon avatar Feb 13 '19 09:02 DpEpsilon

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

dibenede avatar Sep 23 '22 22:09 dibenede