Top "Eval" questions

eval is a function that allows a programmer to execute arbitrary code written in the same language, from a string variable within a code.

Eval is evil... So what should I use instead?

An ajax request returns me a standard JSON array filled with my user's inputs. The input has been sanitized, and …

javascript ajax eval
Dynamic Expression Evaluation in pandas using pd.eval()

Given two DataFrames np.random.seed(0) df1 = pd.DataFrame(np.random.choice(10, (5, 4)), columns=list('ABCD')) df2 = pd.DataFrame(np.random.…

python pandas dataframe eval
Restricting eval() to a narrow scope

I have a javascript file that reads another file which may contain javascript fragments that need to be eval()-ed. …

javascript eval
How to rescue an eval in Ruby?

I'm trying to figure out how to rescue syntax errors that come up when eval()ing code in Ruby 1.8.6. I …

ruby exception eval rescue
Safely sandbox and execute user submitted JavaScript?

I would like to have the ability to let users submit arbitrary JavaScript code, which is then sent to a …

javascript node.js eval sandbox sanitize
Security of Python's eval() on untrusted strings?

If I am evaluating a Python string using eval(), and have a class like: class Foo(object): a = 3 def bar(…

python security eval
Why exactly is eval evil?

I know that Lisp and Scheme programmers usually say that eval should be avoided unless strictly necessary. I’ve seen …

clojure scheme lisp common-lisp eval
Javascript eval() Exception - line number

In JavaScript I have a var str = ".a long string that contains many lines..." In case of exception that caused …

javascript exception eval node.js v8
Append code to the end of an existing function

I need to trigger function bar() whenever function foo() fires. I have no control over function foo or whether it …

javascript eval