closure-compiler
closure-compiler copied to clipboard
'rewrite_polyfills= false' is not working when language_out is present and below ECMASCRIPT_2017
rewrite_polyfills= false
still inject polyfills when language_out is below ECMASCRIPT_2017 for async function
step to reproduce
- echo 'export async function test(){console.log('test');}'> my_program.js
- npx google-closure-compiler --js=my_program.js --js_output_file=out.js --rewrite_polyfills=false --language_out=ECMASCRIPT_2015
async's polyfill is injected into the output.
Should polyfills not be injected under any circumstances when rewrite_polyfills= false
?
I agree that it should use the Promise
implementation (hopefully) available.
Is the shipped polyfill maybe doing something special?
We are experiencing the same problem, affecting our production users on version google-closure-compiler: 20240317.0.0.
as it was working in our previous version 20180805.0.0
Why is this flag no longer working? We don't want the compiler to inject polyfill if we have enabled the flag independently of the language_out.
Our configuration
--platform native
--compilation_level SIMPLE
--language_in ECMASCRIPT5_STRICT
--language_out ECMASCRIPT3
--json_streams OUT
--assume_function_wrapper
--rewrite_polyfills false
--isolate_polyfills
--warning_level QUIET
--externs ${externsJs.path}