webpack/test/helpers/supportsSpread.js

14 lines
239 B
JavaScript
Raw Normal View History

"use strict";
module.exports = function supportsSpread() {
try {
2025-04-22 18:49:30 +08:00
const x = { a: true };
// eslint-disable-next-line no-unassigned-vars
2025-04-22 18:49:30 +08:00
let y;
eval("y = { ...x }");
return y !== x && y.a;
2024-07-31 15:37:05 +08:00
} catch (_err) {
return false;
}
};