Merge pull request #9166 from acozzette/cherry-pick-fixes

Cherry-pick fixes for 3.19.1 and update change log
pull/9176/head
Adam Cozzette 3 years ago committed by GitHub
commit 42ff92a4d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      CHANGES.txt
  2. 2
      php/ext/google/protobuf/package.xml
  3. 3
      ruby/ext/google/protobuf_c/message.c
  4. 9
      src/google/protobuf/compiler/js/js_generator.cc

@ -1,3 +1,15 @@
2021-10-28 version 3.19.1 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
Bazel
* Ensure that release archives contain everything needed for Bazel (#9131)
* Align dependency handling with Bazel best practices (#9165)
JavaScript
* Fix `ReferenceError: window is not defined` when getting the global object (#9156)
Ruby
* Fix memory leak in MessageClass.encode (#9150)
2021-10-15 version 3.19.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
C++
@ -17,6 +29,7 @@
Kotlin
* Switch Kotlin proto DSLs to be implemented with inline value classes
* Fix inlining and deprecation for repeated string fields in kotlin (#9120)
Python
* Proto2 DecodeError now includes message name in error message
@ -37,6 +50,7 @@
* Add class method Timestamp.from_time to ruby well known types (#8562)
* Adopt pure ruby DSL implementation for JRuby (#9047)
* Add size to Map class (#8068)
* Fix for descriptor_pb.rb: google/protobuf should be required first (#9121)
C#
* Correctly set ExtensionRegistry when parsing with MessageParser, but using an already existing CodedInputStream (#7246)

@ -22,7 +22,7 @@
</stability>
<license uri="https://opensource.org/licenses/BSD-3-Clause">3-Clause BSD License</license>
<notes>
* Added &quot;object&quot; as a reserved name (#8962)
* No new changes in 3.19.1
</notes>
<contents>
<dir baseinstalldir="/" name="/">

@ -1012,7 +1012,6 @@ static VALUE Message_decode_json(int argc, VALUE* argv, VALUE klass) {
*/
static VALUE Message_encode(VALUE klass, VALUE msg_rb) {
Message* msg = ruby_to_Message(msg_rb);
upb_arena *arena = upb_arena_new();
const char *data;
size_t size;
@ -1020,6 +1019,8 @@ static VALUE Message_encode(VALUE klass, VALUE msg_rb) {
rb_raise(rb_eArgError, "Message of wrong type.");
}
upb_arena *arena = upb_arena_new();
data = upb_encode(msg->msg, upb_msgdef_layout(msg->msgdef), arena,
&size);

@ -3634,7 +3634,14 @@ void Generator::GenerateFile(const GeneratorOptions& options,
// - self: defined inside Web Workers (WorkerGlobalScope)
// - Function('return this')(): this will work on most platforms, but it may be blocked by things like CSP.
// Function('') is almost the same as eval('')
printer->Print("var global = (function() { return this || window || global || self || Function('return this')(); }).call(null);\n\n");
printer->Print(
"var global = (function() {\n"
" if (this) { return this; }\n"
" if (typeof window !== 'undefined') { return window; }\n"
" if (typeof global !== 'undefined') { return global; }\n"
" if (typeof self !== 'undefined') { return self; }\n"
" return Function('return this')();\n"
"}.call(null));\n\n");
}
for (int i = 0; i < file->dependency_count(); i++) {

Loading…
Cancel
Save