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

Closed
wants to merge 1 commit into 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];
	});

@bladerunner2020
Copy link

bladerunner2020 commented Jun 17, 2024

any update on this? we encountered the same issue with React Native.
tried not to use default export, but it didn't help.
the changed from this PR seems working.

would be very nice if this issue could be resolved.

@6utt3rfly
Copy link
Collaborator

any update on this? we encountered the same issue with React Native. tried not to use default export, but it didn't help. the changed from this PR seems working.

@bladerunner2020 - are you able to follow up on my last comment? Are you able to provide a minimal reproduceable environment so I can confirm the proposed change instead?

@Strate
Copy link
Author

Strate commented Jun 17, 2024

Comparing 4 items is more effective, than performing linear lookup in array. Would be very good if this library keep performance-focused

@bladerunner2020
Copy link

any update on this? we encountered the same issue with React Native. tried not to use default export, but it didn't help. the changed from this PR seems working.

@bladerunner2020 - are you able to follow up on my last comment? Are you able to provide a minimal reproduceable environment so I can confirm the proposed change instead?

I will try prepare it later this week.

@bladerunner2020
Copy link

any update on this? we encountered the same issue with React Native. tried not to use default export, but it didn't help. the changed from this PR seems working.

@bladerunner2020 - are you able to follow up on my last comment? Are you able to provide a minimal reproduceable environment so I can confirm the proposed change instead?

I created a minimal reproducible environment - https://github.com/bladerunner2020/jsep-expo-239. To reproduce the issue you have to install Android emulator. There is a link to instruction how to do this in the readme.

6utt3rfly added a commit that referenced this pull request Jul 6, 2024
NOTE: I could on reproduce this as an issue in Android StrictMode (not JS or React StrictMode)

fixes #239
github-actions bot pushed a commit that referenced this pull request Jul 12, 2024
## [1.3.9](v1.3.8...v1.3.9) (2024-07-12)

### Bug Fixes

* add types add/remove/removeAll functions ([b4a5b1a](b4a5b1a)), closes [#238](#238)
* add types for SequenceExpressions ([d0cf015](d0cf015)), closes [#261](#261)
* detect unexpected ] in expression "[1,2][]" ([70b8ea6](70b8ea6)), closes [#256](#256)
* do not access prototype ([037d1db](037d1db)), closes [#239](#239)
* throwError return type ([e0df539](e0df539)), closes [#252](#252)
* update Array elements typing ([097ae12](097ae12))
Copy link

🎉 This issue has been resolved in version 1.3.9 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

3 participants