Skip to content

Commit

Permalink
iOS Safari: don't clone loader too deeply
Browse files Browse the repository at this point in the history
  • Loading branch information
bmomberger-bitovi committed Jun 8, 2022
1 parent 3ed9b7a commit e732dc4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ext/steal-clone.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ function cloneConfig(obj, isTopLevel) {
clone = {};
for (var attr in obj) {
obj['isCloned'] = true; // prevent infinite recursion
if (hasOwnProperty.call(obj, attr)) {
if (
hasOwnProperty.call(obj, attr) &&
typeof Object.getOwnPropertyDescriptor(obj, attr).get !== 'function' // safari/iOS returns true for hasOwnProperty on getter properties in objects
) {
if (isTopLevel) {
// exclude specific props and functions from top-level of config
if (typeof obj[attr] !== 'function' &&
Expand Down

0 comments on commit e732dc4

Please sign in to comment.