Skip to content

Commit

Permalink
Avoid reserved object property names in generated enumerations (#777)
Browse files Browse the repository at this point in the history
  • Loading branch information
timostamm committed Apr 10, 2024
1 parent d4164a0 commit 4969053
Show file tree
Hide file tree
Showing 7 changed files with 209 additions and 75 deletions.
22 changes: 14 additions & 8 deletions packages/protobuf-test/extra/name-clash.proto
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,25 @@ message ReservedPropertyNames {
enum EnumBuiltIn {
constructor = 0;
toString = 1;
to_JSON = 2;
value_of = 3;
toJSON = 2;
valueOf = 3;
}
enum EnumBuiltInPrefixed {
ENUM_BUILT_IN_PREFIXED_constructor = 0;
ENUM_BUILT_IN_PREFIXED_toString = 1;
ENUM_BUILT_IN_PREFIXED_toJSON = 2;
ENUM_BUILT_IN_PREFIXED_valueOf = 3;
}
enum EnumRuntime {
to_json = 0;
toJson = 0;
type = 6;
clone = 7;
equals = 8;
from_binary = 9;
from_json = 10;
from_json_string = 11;
to_binary = 12;
to_json_string = 14;
fromBinary = 9;
fromJson = 10;
fromJsonString = 11;
toBinary = 12;
toJsonString = 14;
}
message OneofBultIn {
oneof built_in {
Expand Down
61 changes: 43 additions & 18 deletions packages/protobuf-test/src/gen/js/extra/name-clash_pb.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 23 additions & 10 deletions packages/protobuf-test/src/gen/js/extra/name-clash_pb.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

84 changes: 58 additions & 26 deletions packages/protobuf-test/src/gen/ts/extra/name-clash_pb.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4969053

Please sign in to comment.