-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Description
Describe the bug
It seems swc imports incorrect polyfills when use Array.prototype.includes and Array.prototype.at.
Input code
const a = [1,2,3,4].includes(6);
const b = [2,3,4,5].at(-1);Config
{
"jsc": {
"parser": {
"syntax": "ecmascript",
"jsx": false
},
"target": "es3",
"loose": false,
"minify": {
"compress": false,
"mangle": false
}
},
"module": {
"type": "es6"
},
"minify": false,
"isModule": true,
"env": {
"targets": "chrome 40",
"mode": "usage",
"coreJs": "3",
"shippedProposals": true
}
}Playground link
Expected behavior
import "core-js/modules/es.array.includes.js";
import "core-js/modules/esnext.array.at.js";
var a = [1,2,3,4].includes(6);
var b = [2,3,4,5].at(-1);Actual behavior
import "core-js/modules/es.array.includes.js";
import "core-js/modules/es.string.includes.js";
import "core-js/modules/esnext.string.at.js";
var a = [1,2,3,4].includes(6);
var b = [2,3,4,5].at(-1);Version
1.3.40
Additional context
No response