zloirock / core-js

Standard Library
MIT License
24.6k stars 1.66k forks source link

Spec mismatch in `Array.prototype.reduce` #1327

Closed stonechoe closed 9 months ago

stonechoe commented 9 months ago

Following code behaves differently depending on whether the native version is loaded, or if the polyfill is required and loaded:

const reduce = require("core-js-pure/actual/array/reduce");

const handler = {
  has: () => {
    throw 42;
  },
};

const y = new Proxy([], handler);

reduce(y, (e) => e);