javascript - Create a dynamic function without eval() or Function constructor -


i have function body in string. say,

str "return a+b"

for function takes 2 arguments a , b. how create anonymous (or named) function string? trying make application content security policy compliant , therefore using eval , function constructor not option. apparently, can done using prototypes maybe. ideas?


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -