-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Object spread causes polyfills even in modern language_out #4098
Comments
How have you configured the compiler to run and how are you invoking it? In my IntegrationTest the polyfills are only getting injected if I set the language_out to ES3. |
Will post later, but can be found here: https://github.com/L3P3/lui/blob/master/build.js#L51 Also just noticed that the polyfill code has both defineProperty and defineProperties there, which seems very weird. |
Sorry, for ES2020, there are no polyfills, but for ES5, there is! My mistake in writing this issue! 😅 I am trying to nail it down. What I got so far is that the polyfill appears even with this code: // ==ClosureCompiler==
// @compilation_level ADVANCED_OPTIMIZATIONS
// @language_out ECMASCRIPT5_STRICT
// @rewrite_polyfills false
// @output_file_name default.js
// ==/ClosureCompiler==
(() => {
Object.assign;
false ? { ...{} } : null;
})(); The polyfill code only appears when both lines inside the function are there. If you comment out one of those, it is not appearing. Note that I DISABLED polyfills explicitly but they still appear... 😉 |
Version: From at least mid 2022 up to latest.
compilation_level ADVANCED
language_out ECMASCRIPT_2020
rewrite_polyfills false
With ES2020 and up, using
{x:foo, ...bar}
causes this to be added to the head:Summary: Abstract polyfill support, single
Object.assign
polyfill.When I use
Object.assign({x:foo}, bar)
, this disabled + useless polyfill stuff is not in there. susSince this adds almost a kilobyte, I deem this worth fixable. In ES2020, there is no point in having an
Object.assign
polyfill. 😉The text was updated successfully, but these errors were encountered: