To be "exactly" like eval, use eval. What property about eval do you need? "this" is set by how you call a function, it can change on every call (except for bound functions). Closure scope in eval is probably what you're talking about. I generally use runInNewContext and pass in all the variables manually I needed from the closure.
On Sat, Jul 28, 2012 at 2:44 AM, Seiji Sam Lee <[email protected]> wrote: > I am working in a project that implements a basic plug-in engine. > > I tried to use runInNewContext(...) and the rest of similar implementations > in VM module; but finally only was able to do using eval. > > My fault is I don't understand well contexts, 'this' keyword and so, but I > could improve my knowledge if somebody ask this question: > > How can emulate 'exactly' eval using only methods from VM module? > > volunteers? > > > > Thank you in advance, I had been working for 10 hours straight and I am not > able to think with properly XD > > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
