diff --git a/javascript/net/grpc/web/grpc_generator.cc b/javascript/net/grpc/web/grpc_generator.cc index b3c2700d..97478ff4 100644 --- a/javascript/net/grpc/web/grpc_generator.cc +++ b/javascript/net/grpc/web/grpc_generator.cc @@ -317,15 +317,12 @@ string ModuleAlias(const string& filename) { } string JSMessageType(const Descriptor *desc, const FileDescriptor *file) { - string result; + string module_prefix; if (desc->file() != file) { - result = ModuleAlias(desc->file()->name()); - } - result += StripPrefixString(desc->full_name(), desc->file()->package()); - if (!result.empty() && result[0] == '.') { - result = result.substr(1); + module_prefix = ModuleAlias(desc->file()->name()) + "."; } - return result; + + return module_prefix + desc->name(); } string JSElementType(const FieldDescriptor *desc, const FileDescriptor *file)