Skip to content

Commit

Permalink
Improve React Native compatibility (#41)
Browse files Browse the repository at this point in the history
Co-authored-by: Pedro Augusto de Paula Barbosa <papb1996@gmail.com>
  • Loading branch information
jjd314 and papb committed Jul 24, 2020
1 parent a08e9cd commit 260d6e3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ const copyProperty = (to, from, property, ignoreNonConfigurable) => {
return;
}

// `Function#arguments` and `Function#caller` should not be copied. They were reported to be present in `Reflect.ownKeys` for some devices in React Native (#41), so we explicitly ignore them here.
if (property === 'arguments' || property === 'caller') {
return;
}

const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);

Expand Down

0 comments on commit 260d6e3

Please sign in to comment.