Hello, I'm not sure this is a bug or if I misunderstood something in how SWC is polyfiling code.
I'm trying to bundle and polyfill the following code to es5.
// output.js
var object1 = {
property1: 42
};
var descriptors1 = Object.getOwnPropertyDescriptors(object1);
I can see const has been successfully changed to var, but the method Object.getOwnPropertyDescriptors has not been polyfilled (it's an es7 feature and is not available in es5).
Describe the bug
Hello, I'm not sure this is a bug or if I misunderstood something in how SWC is polyfiling code. I'm trying to bundle and polyfill the following code to es5.
The polyfill output is:
I can see
const
has been successfully changed tovar
, but the methodObject.getOwnPropertyDescriptors
has not been polyfilled (it's an es7 feature and is not available in es5).Thanks for you help
Input code
No response
Config
Playground link (or link to the minimal reproduction)
https://play.swc.rs/?version=1.3.100&code=H4sIAAAAAAAAA0WNzQpAQBCA7%2FMUc6RE5ERu7jyDNbTadrbdKW3y7rIp9%2B9HsQ2CvBykpMYBL0B0nh15iXWHbVPA3UNVoWVBxyZu2hhaQSVvpaC8dsI%2BvPKUMuVOMp12%2Firjz2TfJ%2B8BHh1q2VB5AAAA&config=H4sIAAAAAAAAA1VPSQ7DIAy85xXI51576R%2F6CIs4ERGbMEhFUf5eCJC0J3sWz8j7JARsLOEl9rIW4DEwhQsXhrON%2BCkMkDTIMigf4THUjau0oGZq3NEGRAwrxfOMn90P2jmmwsWQuh2MsmrJv4XSGR%2BI%2BT%2B3WtGumgbd2qbeCMbN6RT7IzH7iiCZGW7TKLuCQfF7XLbY4wtDWkJnFQEAAA%3D%3D
SWC Info output
No response
Expected behavior
The code should be polyfilled using the core-js
object/get-own-property-descriptors
polyfill.Actual behavior
No response
Version
1.3.100
Additional context
No response