Skip to content

Commit 3050f03

Browse files
committed
Do not ignore descriptor extensions
Previously, we blanket ignored extensions against the descriptor well known type for historical reasons. We marked this for cleanup in #85; this change follows through on it.
1 parent 4ce9069 commit 3050f03

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

generator/js_generator.cc

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -430,20 +430,12 @@ std::string GetEnumFileName(const GeneratorOptions& options,
430430
// Returns the message/response ID, if set.
431431
std::string GetMessageId(const Descriptor* desc) { return std::string(); }
432432

433-
bool IgnoreExtensionField(const FieldDescriptor* field) {
434-
// Exclude descriptor extensions from output "to avoid clutter" (from original
435-
// codegen).
436-
if (!field->is_extension()) return false;
437-
const FileDescriptor* file = field->containing_type()->file();
438-
return file->name() == "net/proto2/proto/descriptor.proto" ||
439-
file->name() == "google/protobuf/descriptor.proto";
440-
}
441-
442433
// Used inside Google only -- do not remove.
443434
bool IsResponse(const Descriptor* desc) { return false; }
444435

445436
bool IgnoreField(const FieldDescriptor* field) {
446-
return IgnoreExtensionField(field);
437+
// no-op in open source
438+
return false;
447439
}
448440

449441
// Do we ignore this message type?

jasmine.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"google/protobuf/any.js",
1212
"google/protobuf/struct.js",
1313
"google/protobuf/timestamp.js",
14+
"google/protobuf/descriptor.js",
1415
"testproto_libs1.js",
1516
"testproto_libs2.js"
1617
]

0 commit comments

Comments
 (0)