index.js 256 B

1234567891011
  1. module.exports = function hasObjectSpread () {
  2. var obj = {
  3. d: 3,
  4. e: 4
  5. }
  6. try {
  7. var result = Function('a', 'return { c: 1, ...a, d: 2 }')(obj)
  8. return result.c === 1 && result.d === 2 && result.e === 4
  9. } catch (err) { return false }
  10. }