From a3a65b320d6bde3bae6c367ae83c265006cbf46b Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 24 Jul 2017 22:41:09 +0200 Subject: Fix issue #1745 - javascript allow dot in filename --- src/google/protobuf/compiler/js/js_generator.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'src/google') diff --git a/src/google/protobuf/compiler/js/js_generator.cc b/src/google/protobuf/compiler/js/js_generator.cc index 7c63e58f..97b88890 100755 --- a/src/google/protobuf/compiler/js/js_generator.cc +++ b/src/google/protobuf/compiler/js/js_generator.cc @@ -193,6 +193,7 @@ string ModuleAlias(const string& filename) { string basename = StripProto(filename); StripString(&basename, "-", '$'); StripString(&basename, "/", '_'); + StripString(&basename, “.”, '_'); return basename + "_pb"; } -- cgit v1.2.3 From 2b6db00de1276a1d71722e69b1f8b9ecb65abc96 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 24 Jul 2017 23:00:49 +0200 Subject: Fix quotation marks --- src/google/protobuf/compiler/js/js_generator.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/google') diff --git a/src/google/protobuf/compiler/js/js_generator.cc b/src/google/protobuf/compiler/js/js_generator.cc index 97b88890..2d86d1c8 100755 --- a/src/google/protobuf/compiler/js/js_generator.cc +++ b/src/google/protobuf/compiler/js/js_generator.cc @@ -193,7 +193,7 @@ string ModuleAlias(const string& filename) { string basename = StripProto(filename); StripString(&basename, "-", '$'); StripString(&basename, "/", '_'); - StripString(&basename, “.”, '_'); + StripString(&basename, ".", '_'); return basename + "_pb"; } -- cgit v1.2.3 From 21800ff84ff0b68833e321e02c3c50f83047fd92 Mon Sep 17 00:00:00 2001 From: Thomas Van Lenten Date: Wed, 26 Jul 2017 15:41:31 -0400 Subject: Add a objc_class_prefix to test_messages_proto3.proto. Both test_messages_proto3.proto & test_messages_proto2.proto define message ForeignMessage {...} and enum ForeignEnum {...} but since objc doesn't use the proto package in the naming, these end up conflicting. Adding the objc_class_prefix option to the proto3 file ensure the generated objc types are all unique. --- conformance/conformance_objc.m | 6 +++--- src/google/protobuf/test_messages_proto3.proto | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/google') diff --git a/conformance/conformance_objc.m b/conformance/conformance_objc.m index ba1c946f..a5012ec4 100644 --- a/conformance/conformance_objc.m +++ b/conformance/conformance_objc.m @@ -63,7 +63,7 @@ static NSData *CheckedReadDataOfLength(NSFileHandle *handle, NSUInteger numBytes static ConformanceResponse *DoTest(ConformanceRequest *request) { ConformanceResponse *response = [ConformanceResponse message]; - TestAllTypesProto3 *testMessage = nil; + Proto3TestAllTypesProto3 *testMessage = nil; switch (request.payloadOneOfCase) { case ConformanceRequest_Payload_OneOfCase_GPBUnsetOneOfCase: @@ -73,8 +73,8 @@ static ConformanceResponse *DoTest(ConformanceRequest *request) { case ConformanceRequest_Payload_OneOfCase_ProtobufPayload: { if ([request.messageType isEqualToString:@"protobuf_test_messages.proto3.TestAllTypesProto3"]) { NSError *error = nil; - testMessage = [TestAllTypesProto3 parseFromData:request.protobufPayload - error:&error]; + testMessage = [Proto3TestAllTypesProto3 parseFromData:request.protobufPayload + error:&error]; if (!testMessage) { response.parseError = [NSString stringWithFormat:@"Parse error: %@", error]; diff --git a/src/google/protobuf/test_messages_proto3.proto b/src/google/protobuf/test_messages_proto3.proto index abf73427..84b9da99 100644 --- a/src/google/protobuf/test_messages_proto3.proto +++ b/src/google/protobuf/test_messages_proto3.proto @@ -39,6 +39,7 @@ syntax = "proto3"; package protobuf_test_messages.proto3; option java_package = "com.google.protobuf_test_messages.proto3"; +option objc_class_prefix = "Proto3"; // This is the default, but we specify it here explicitly. option optimize_for = SPEED; -- cgit v1.2.3