Skip to content

Commit

Permalink
add a workaround for 3rd party Reflect.set polyfill bug, #847
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Oct 27, 2020
1 parent f8ccb9b commit 4af6233
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
##### Unreleased
- `String#replaceAll` moved to the stable ES, [per Jun TC39 meeting](https://github.com/tc39/notes/blob/master/meetings/2020-06/june-2.md#stringprototypereplaceall-for-stage-4)
- `process.nextTick` have a less priority when `Promise` in the microtask implementation, [#855](https://github.com/zloirock/core-js/issues/855)
- Added a workaround for 3rd party `Reflect.set` polyfill bug, [#847](https://github.com/zloirock/core-js/issues/847)

##### 3.6.5 - 2020.04.09
- Updated Browserlist [#755](https://github.com/zloirock/core-js/issues/755)
Expand Down
5 changes: 3 additions & 2 deletions packages/core-js/modules/es.reflect.set.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ function set(target, propertyKey, V /* , receiver */) {
// MS Edge 17-18 Reflect.set allows setting the property to object
// with non-writable property on the prototype
var MS_EDGE_BUG = fails(function () {
var object = definePropertyModule.f({}, 'a', { configurable: true });
var Constructor = function () { /* empty */ };
var object = definePropertyModule.f(new Constructor(), 'a', { configurable: true });
// eslint-disable-next-line no-undef
return Reflect.set(getPrototypeOf(object), 'a', 1, object) !== false;
return Reflect.set(Constructor.prototype, 'a', 1, object) !== false;
});

$({ target: 'Reflect', stat: true, forced: MS_EDGE_BUG }, {
Expand Down

0 comments on commit 4af6233

Please sign in to comment.