File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -3638,14 +3638,13 @@ void Generator::GenerateFile(const GeneratorOptions& options,
36383638 // may be blocked by things like CSP.
36393639 // Function('') is almost the same as eval('')
36403640 printer->Print (
3641- " var global = (function() {\n "
3642- " if (this) { return this; }\n "
3643- " if (typeof globalThis !== 'undefined') { return globalThis; }\n "
3644- " if (typeof window !== 'undefined') { return window; }\n "
3645- " if (typeof global !== 'undefined') { return global; }\n "
3646- " if (typeof self !== 'undefined') { return self; }\n "
3647- " return Function('return this')();\n "
3648- " }).call(null);\n\n " );
3641+ " var globalThis = typeof globalThis !== 'undefined' && globalThis;\n "
3642+ " var window = typeof window !== 'undefined' && window;\n "
3643+ " var global = typeof global !== 'undefined' && global;\n "
3644+ " var self = typeof self !== 'undefined' && self;\n "
3645+ " var global = globalThis || window || global || self ||\n "
3646+ " (function () { return this; }).call(null) ||\n "
3647+ " Function('return this')();\n\n " );
36493648 }
36503649
36513650 for (int i = 0 ; i < file->dependency_count (); i++) {
You can’t perform that action at this time.
0 commit comments