Thanks Tim, but it's more complicated than this.

It would be the sum of two errors, maybe a lack in runIn{New,This}Context and sure a lack in my mind!

But the reality is that this code doesn't work for me (into a runInNewContext):

var WIDTH =750;
var HEIGHT=300;

console.log(Util.inspect(this));

//Util is from require("Utils");

it prints {} when executed into a runInNewContext

Where are the objected stored?

I have discarded a fail in my code (=owned candidate?)

El 28/07/12 21:10, Tim Caswell escribió:
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

Reply via email to