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

Use new Function() instead of eval() #69

Merged
merged 1 commit into from
Nov 16, 2017

Conversation

TimMensch
Copy link
Contributor

When using pixi-particles with Rollup.js, it will throw an error if you use eval() directly. See https://github.com/rollup/rollup/wiki/Troubleshooting#avoiding-eval

This should be effectively identical to the eval call, except for the possibility of eval grabbing or writing to local variables (a trait that the original code actually relied on). This also feels marginally cleaner, though it's only fractionally more secure.

Tested to verify that it still works as expected.

* When using pixi-particles with Rollup.js, it will throw an error if you use eval() directly. See https://github.com/rollup/rollup/wiki/Troubleshooting#avoiding-eval
@andrewstart
Copy link
Collaborator

Thanks, I had been thinking about going back to do this (didn't know you could make functions this way when I first wrote it).

@andrewstart andrewstart merged commit 984115e into pixijs-userland:master Nov 16, 2017
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