Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'rewrite_polyfills= false' is not working when language_out is present and below ECMASCRIPT_2017 #4080

Open
icy0307 opened this issue Apr 3, 2023 · 2 comments

Comments

@icy0307
Copy link

icy0307 commented Apr 3, 2023

rewrite_polyfills= false still inject polyfills when language_out is below ECMASCRIPT_2017 for async function

step to reproduce

  1. echo 'export async function test(){console.log('test');}'> my_program.js
  2. 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 ?

@L3P3
Copy link

L3P3 commented Jun 7, 2023

I agree that it should use the Promise implementation (hopefully) available.
Is the shipped polyfill maybe doing something special?

@eduardoacskimlinks
Copy link

eduardoacskimlinks commented May 29, 2024

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}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants