Skip to content

Commit a1d2ea3

Browse files
author
alias-rahil
committed
refactor: make checks inline
1 parent eef12bf commit a1d2ea3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

generator/js_generator.cc

+7-7
Original file line numberDiff line numberDiff line change
@@ -3638,13 +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 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");
3641+
"var global =\n"
3642+
" (typeof globalThis !== 'undefined' && globalThis) ||\n"
3643+
" (typeof window !== 'undefined' && window) ||\n"
3644+
" (typeof global !== 'undefined' && global) ||\n"
3645+
" (typeof self !== 'undefined' && self) ||\n"
3646+
" (function () { return this; }).call(null) ||\n"
3647+
" Function('return this')();\n\n");
36483648
}
36493649

36503650
for (int i = 0; i < file->dependency_count(); i++) {

0 commit comments

Comments
 (0)