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

Replace eval() for parsing JSON strings #465

Merged
merged 11 commits into from
Apr 17, 2023
Merged

Conversation

sfc-gh-ext-simba-lf
Copy link
Collaborator

@sfc-gh-ext-simba-lf sfc-gh-ext-simba-lf commented Apr 3, 2023

Regarding issue 271

The PR replaces eval which is considered unsafe with better-eval which executes the code in a different scope and blocks the usage of global variables

@sfc-gh-ext-simba-lf
Copy link
Collaborator Author

The better-eval module creates objects in a VM which causes an assertion fail when assert.deepStrictEqual is used: nodejs/node#44462

The assertions for test involving the eval function are changed so that only the object's values are checked for equality

@sfc-gh-ext-simba-lf sfc-gh-ext-simba-lf marked this pull request as ready for review April 14, 2023 20:15
@sfc-gh-ext-simba-lf sfc-gh-ext-simba-lf requested a review from a team as a code owner April 14, 2023 20:15
Copy link
Collaborator

@sfc-gh-igarish sfc-gh-igarish left a comment

Choose a reason for hiding this comment

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

LGTM

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.

2 participants