-
Notifications
You must be signed in to change notification settings - Fork 49
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
Eval causes problems in closure compiler #35
Comments
Ok so I have a fix, but I'm positive that the same functionality can be achieved without using eval, which as we all know is evil... |
we've all been told i'm curious how you think it could be done without eval - not that i don't think it could, but wondering how you would approach it. |
Lately I've been working on a concatenative dsl based on dojo. Once the file is parsed into an object I never have to use eval, as everything is either a single function, or a for-loop of function calls. Since the object here is to chain functions, I think a similar approach can be used. The array could just be threaded along. Do you think this would impact performance much? Perhaps my library would benefit from eval. Imo Felix merely points out that eval is great for slapping together huge quantities of data (wrapping it with new Function). |
I have created a (temporary) fix, where name of the function "op" is not hardcoded in string, but dynamically computed:
where function fnName is defined as:
|
This is correct, IE is oblivious to function.name. |
Sorry #37 was not mention here, so I have missed it. And yes, regexp fallback is need in IE. |
I would opt for a function.name shim, however. |
The problem is in js-array.js line 401: op() is no longer referenced correctly after the function name is shortened.
It would be really useful to rewrite rql/js-array with a whole lot less eval where possible...
The text was updated successfully, but these errors were encountered: