File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -3615,8 +3615,14 @@ void Generator::GenerateClassSerializeBinaryField(
3615
3615
void Generator::GenerateEnum (const GeneratorOptions& options,
3616
3616
io::Printer* printer,
3617
3617
const EnumDescriptor* enumdesc) const {
3618
+
3619
+ const bool is_toplevel = enumdesc->containing_type () == nullptr ;
3620
+ const std::string enumNamePrefix = is_toplevel ? " export const " : " " ;
3621
+
3622
+ // TODO(reddaly): If the enum is defined at top-level, we need
3623
+ // 'const <EnumName> = ' instead of '<EnumType> = '
3618
3624
const std::string enumNameForDefinition = options.WantEs6 () ? (
3619
- enumdesc->name ()
3625
+ enumNamePrefix + enumdesc->name ()
3620
3626
) : (
3621
3627
GetEnumPathPrefix (options, enumdesc) + enumdesc->name ()
3622
3628
);
You can’t perform that action at this time.
0 commit comments