CrowdProcess/formula.js — pull request #2 by hmalphettes (2014-08-13 03:12:34+00:00)
Title: Replace eval by a jsep evaluator

This is an experiment to replace the evals with an evaluator of an AST produced by (jsep)[http://jsep.from.so/]

jsep produces an AST that is compatible with Esprima but it weighs only 600 lines of code and 1kb once minified.

The original issue was filed here: https://github.com/sutoiku/formula.js/issues/27
You guys were asking if we had some ideas regarding this and most importantly, I am a lot more at ease developing on the top of your branch than the original one at Sutoiku.
So I am making a PR here.

It works well enough for the test suite but it is very brittle: errors in the expression will put some noise in the console and the expression's node that did not work will return undefined and move-on.

Let me know if you find this promising enough.