Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not access prototype, callee, caller & arguments properties #239

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Strate
Copy link

@Strate Strate commented Dec 26, 2022

Im tried to use this library in react-native with Hermes JS engine enabled, and got errors.
Trying to access caller, callee, arguments properties retults to TypeError: Restricted in strict mode

Related links:
facebook/react-native#34868
axios/axios#4998 (comment)
axios/axios#5231
axios/axios#5152

Copy link
Collaborator

@6utt3rfly 6utt3rfly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! At 4 items being compared now, can you switch to using an array instead? Can you also please check the contributing doc for formatting your commit message?

@6utt3rfly
Copy link
Collaborator

6utt3rfly commented Jun 24, 2023

@Strate - are you able to provide a minimal environment that this occurs (cjs/esm? browser/node? which version?)?

I'm thinking of a change more like this, which I'd like to confirm first:

const stdClassProps = Object.getOwnPropertyNames(class Test{});
Object.getOwnPropertyNames(Jsep)
	.filter(prop => !stdClassProps.includes(prop) && jsep[prop] === undefined)
	.forEach((m) => {
		jsep[m] = Jsep[m];
	});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants