-
Notifications
You must be signed in to change notification settings - Fork 37
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
Does not handle non-expressions correctly #11
Comments
|
hey folks, wrap it in a function
won't work but
does work. |
@phablulo: You fail to see the point: Also note that your wrapped code is not the same as then original version (because you've inserted a |
It would be an easy fix but there are 2 tests that are failing:
The reason is that the normal
If this npm module is supposed to be a drop-in replacement for We can argue that this library is not a drop-in replacement for many reasons (support of |
@ChrisCinelli I believe that is, because it's an object, it has to be wrapped in parentheses. I think you should check if the first non-whitespace character is a |
Share your code so far and I can send a PR to help you fix the other test. I've done stuff like this before. |
@fabiosantoscode, |
eval('var x = 21; x * 2')
returns42
, butsafeEval('var x = 21; x * 2')
crashes:The text was updated successfully, but these errors were encountered: