-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Description
Describe the bug
use
import swc from '@swc/core';
swc.minify(code, { compress: true, mangle: true });
output code
Run this in Safari (iOS 16.2) throw error: Duplicate parameter 'e' not allowed in function with destructuring parameters
Input code
(function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
let _liteContractCode = null;
async function showPopup({ mallId }) {
try {
console.log({
mallId: mallId,
});
} catch (e) {
console.log(e);
}
}
const liteContractHelper = {
showPopup,
get liteContractCode () {
return _liteContractCode;
}
};
liteContractHelper.showPopup({ mallId: 1 });
})();Link to the code that reproduces this issue
https://github.com/yizhiyuyou/swc-minify-demo/blob/main/index.mjs
SWC Info output
var __unused_webpack_module,__webpack_exports__,__webpack_require__;({showPopup:async function e({mallId:e}){try{console.log({mallId:e})}catch(e){console.log(e)}},get liteContractCode(){return null}}).showPopup({mallId:1});
Expected behavior
not error
Actual behavior
No response
Version
1.13.5
Additional context
No response
Liu-S-F