diff options
| author | mikhnenko <[email protected]> | 2024-06-25 08:50:35 +0300 |
|---|---|---|
| committer | mikhnenko <[email protected]> | 2024-06-25 09:00:27 +0300 |
| commit | 509c9fc9e7b9c3b8be7307d72a4c966e5f9aa194 (patch) | |
| tree | 4b8a6a44009906ac852e59efa0bc78bb12043a5b /contrib/libs/protoc/src/google/protobuf/compiler/js | |
| parent | 7688f2313619a39a60ef3c2734d8efbc49a0a6db (diff) | |
Update protobuf to 3.20.2 and pyprotobuf to 3.20.3
Если это pull-request что-то сломал, то:
- если это тест с канонизацией и еще нет pr с переканонизацией, то переканонизируйте пожалуйста сами
- проверьте, что тест не флапает
- приходите в [DEVTOOLSSUPPORT](https://st.yandex-team.ru/createTicket?queue=DEVTOOLSSUPPORT) - там вам обязательно помогут
987be5ed151f827f7f292f32420470b04b71a91d
Diffstat (limited to 'contrib/libs/protoc/src/google/protobuf/compiler/js')
| -rw-r--r-- | contrib/libs/protoc/src/google/protobuf/compiler/js/js_generator.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/js/js_generator.cc b/contrib/libs/protoc/src/google/protobuf/compiler/js/js_generator.cc index 019ef3a5b5a..8c9fadf0678 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/js/js_generator.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/js/js_generator.cc @@ -3625,16 +3625,19 @@ void Generator::GenerateFile(const GeneratorOptions& options, if (options.import_style == GeneratorOptions::kImportCommonJsStrict) { printer->Print("var proto = {};\n\n"); } else { - // To get the global object we call a function with .call(null), this will set "this" inside the - // function to the global object. - // This does not work if we are running in strict mode ("use strict"), - // so we fallback to the following things (in order from first to last): + // To get the global object we call a function with .call(null), this will + // set "this" inside the function to the global object. This does not work + // if we are running in strict mode ("use strict"), so we fallback to the + // following things (in order from first to last): // - window: defined in browsers // - global: defined in most server side environments like NodeJS // - 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('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() { return this || window || global || self " + "|| Function('return this')(); }).call(null);\n\n"); } for (int i = 0; i < file->dependency_count(); i++) { |
