Skip to content

Commit 47d11d0

Browse files
committed
added a workaround of possible browser crash on Object.prototype accessors method in WebKit ~ Android 4.0, close #232
1 parent 991d46b commit 47d11d0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Changelog
22
##### Unreleased
3-
- Nothing
3+
- Added a workaround of possible browser crash on `Object.prototype` accessors method in WebKit ~ Android 4.0, [#232](https://github.com/zloirock/core-js/issues/232)
44

55
##### 3.13.0 - 2021.05.26
66
- Accessible `Object#hasOwnProperty` (`Object.hasOwn`) proposal moved to the stage 3, [May 2021 TC39 meeting](https://github.com/babel/proposals/issues/74#issuecomment-848121673)

packages/core-js/internals/object-prototype-accessors-forced.js

+5
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22
var IS_PURE = require('../internals/is-pure');
33
var global = require('../internals/global');
44
var fails = require('../internals/fails');
5+
var userAgent = require('../internals/engine-user-agent');
56

67
// Forced replacement object prototype accessors methods
78
module.exports = IS_PURE || !fails(function () {
9+
// This feature detection crashes old WebKit
10+
// https://github.com/zloirock/core-js/issues/232
11+
var webkit = userAgent.match(/AppleWebKit\/(\d+)\./);
12+
if (webkit && +webkit[1] < 535) return;
813
var key = Math.random();
914
// In FF throws only define methods
1015
// eslint-disable-next-line no-undef, no-useless-call -- required for testing

0 commit comments

Comments
 (0)