-
Notifications
You must be signed in to change notification settings - Fork 218
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
Fix eval #491
base: javascript_sandbox
Are you sure you want to change the base?
Fix eval #491
Conversation
e3fc550
to
9c2bf7d
Compare
Codecov Report
@@ Coverage Diff @@
## master #491 +/- ##
==========================================
- Coverage 18.91% 18.64% -0.27%
==========================================
Files 107 107
Lines 4208 4140 -68
==========================================
- Hits 796 772 -24
+ Misses 3412 3368 -44
Continue to review full report at Codecov.
|
9c2bf7d
to
6c3fe34
Compare
A fallback (with a warning) if it fails would be good. |
|
||
def eval_in_node(js: str): | ||
def eval_in_node(js: str, sandbox: str = "{}"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be transparent? We can't assume the next developer (who's going to use eval_in_node
for implementing a provider) to know how to construct a sandbox string.
We should use https://github.com/amol-/dukpy instead, that would also remove our dependency for nodejs. |
This addresses #486. It will almost definitely have broken other places that use
eval_in_node
. I'll add commits fixing those later. I'll also write some guidelines on how to use the js evaluation since it's gotten a bit more complicated than before. Hopefully the end result will be more robust and rely less on parsing scripts as strings.