cesanta / v7

Embedded JavaScript engine for C/C++

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

calling `eval` indirectly does not reflect globally

kyriosli opened this issue · comments

We know that eval does not touch the local variable if it is called indirectly, for example:

(function(Math) { return (0,eval)("Math") })(1234)
// returns global.Math

and this did not work properly in v7.

yeah, it's a known problem. We currently treat eval as a normal function.
This issue will be fixed when we finally implement compact stack frames for function calls; for that to work we'll have to treat explicit calls to eval specially (and thus indirectly also fix this test-case).
No ETA for the moment.

BTW, @kyriosli, what is your use case ?