Open brettz9 opened 9 years ago
Thank you for your feedback.
Actually Function is used to precompile code which iterates over schema/object to get performance. I saw that a lot of libraries like template engines (handlebars, jade) or JSON schema validators use Function for the same reason. So I do not think it is really evil here.
First version did not use it, but performance was terrible. How would you suggest to achieve the similar performance without code generation?
Do you mean that code generation using such as the following example of a closure pattern has too high of performance problems? I'd actually think that eval() would be slower:
function buildForCallback (i, end, inc, cb) {
return function () {
for (; i < end; i += inc) {
cb();
}
};
}
Would you be open to a PR to get rid of the Function usage? This is discouraged practice and can be implemented by other means. Thanks!