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

Remove str-to-func eval of named function factory #17296

Closed
wants to merge 1 commit into from

Conversation

NickCarducci
Copy link
Contributor

return the object key [name] as caller.name of the new function

return the object key [name] as caller.name of the new function
@kripken
Copy link
Member

kripken commented Jun 22, 2022

Looks like this causes errors on tests on CI. Let us know if you need help debugging those.

#endif
return {
[name]: function () {
return body.apply(body, arguments);
Copy link

@LiuWilson00 LiuWilson00 Feb 13, 2023

Choose a reason for hiding this comment

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

Hello, your pull request is very helpful for me.
but I don't understand why use "body.apply(body, arguments);" in here rather than "body.apply(this, arguments);".
In my case , I change createNamedFunction used "body.apply(body, arguments)" had some error.
but "body.apply(this, arguments)" is work for me.

anyway, thank you so much again,you save me to solu the CSP trouble!!

@sbc100
Copy link
Collaborator

sbc100 commented Feb 14, 2023

I'd think we should move forward with this patch. I tested it locally with body.apply(this, arguments) instead of body.apply(body, arguments) and the tests seem to pass.

@NickCarducci do you have time to update this PR or should I upload a new one?

sbc100 pushed a commit that referenced this pull request Feb 14, 2023
For support for this feature see:
ttps://caniuse.com/mdn-javascript_operators_object_initializer_computed_property_names

Based on #17296
sbc100 pushed a commit that referenced this pull request Feb 14, 2023
For support for this feature see:
ttps://caniuse.com/mdn-javascript_operators_object_initializer_computed_property_names

Based on #17296
@NickCarducci
Copy link
Contributor Author

I'd think we should move forward with this patch. I tested it locally with body.apply(this, arguments) instead of body.apply(body, arguments) and the tests seem to pass.

@NickCarducci do you have time to update this PR or should I upload a new one?

I don't want to be a collaborator based on this, at least.

@NickCarducci NickCarducci deleted the patch-9 branch February 14, 2023 20:01
sbc100 pushed a commit that referenced this pull request Feb 14, 2023
For support for this feature see:
ttps://caniuse.com/mdn-javascript_operators_object_initializer_computed_property_names

Based on #17296
sbc100 added a commit that referenced this pull request Feb 15, 2023
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.

4 participants