Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Use Function Objects for deserialization, instead of eval#159

Open
tornikeshavishvili wants to merge 1 commit intoyahoo:main from
tornikeshavishvili:main
Open

Use Function Objects for deserialization, instead of eval #159
tornikeshavishvili wants to merge 1 commit intoyahoo:main from
tornikeshavishvili:main

Conversation

@tornikeshavishvili
Copy link

@tornikeshavishvili tornikeshavishvili commented Jan 21, 2023

I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.

@tornikeshavishvili tornikeshavishvili changed the title (削除) Use Function Objects for deserialization, instead of eval #158 (削除ここまで) (追記) Use Function Objects for deserialization, instead of eval (追記ここまで) Jan 21, 2023
Copy link
Collaborator

okuryu commented Jan 23, 2023

As noted in the description, deserialization is not a use case for this module.
https://github.com/yahoo/serialize-javascript#deserializing

Copy link
Author

As noted in the description, deserialization is not a use case for this module. https://github.com/yahoo/serialize-javascript#deserializing

At least the provided example using eval would be nice to have been changed with Function objects.
BUT . . .
Yes noted but not backed with arguments and we humbly disagree. Why is this case? We are loading users with task to implement deserialization, which should not be the case, because it shifts their attention and energy from whatever they are doing to the task that could have been provided by this module. This is very uncomfortable from a lot of viewpoints.

Copy link
Collaborator

okuryu commented Jan 24, 2023

If you have a better way to deserialization, please update the example and suggest it instead of changing the code.

Copy link
Author

If you have a better way to deserialization, please update the example and suggest it instead of changing the code.

If you agree that deserialization with Function objects is better, then i will commit readme :|

Copy link
Collaborator

okuryu commented Jan 27, 2023

It depends on what perspective is better. My understanding is that neither eval() nor new Function() is necessarily safe. There are security risks in both. If you use them, it is a prerequisite that you know what data is passed to them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /