Thanks for your reply, and code.

*> Well, what are you expecting in an empty this object? XD You have 
nothing assigned to it! Therefore, it will stay empty.*

I does a mistake about scope (with"dummy"), but I expected to see Node 
"require". Running code with Node allow you to call "require" from 
everywhere. But with my C++ code I can't call JS code with "require". I 
want to understand why I have such a difference between JS code run 
"directly" and JS code called from C++. Of course I didn't understand 
something but I didn't see what.

I'll have to admit my first post was not clear enough. Perhaps could have I 
asked "Why I didn't see Node stuff, can't call Node sufff from my JS code 
called from C++ like I does" Sorry. I'll check you sample code, and take 
more time in V8 documentation.

*> [...] **run arbitary JS code. But to be honest, I would not do this. 
Consider the binary functions as access into the low level, and try to 
write as much as you can via JavaScript.*

YES, I agree with that. C++ for low level, and don't doing a awful 
spaghetti code between C++ and JS. But in a particular case I search a way 
to run hidden JS code. Just a small part of code nobody has to see or touch 
after deployment on customer infrastructure. The idea is to load encrypted 
JS code, decrypt it from C++, and run it when needed. But I need Node 
functionality (like "require"), not just V8.

I know there are others problems than just running JS code from C++, i.e. 
because with JS it's easy to display function code. But one problem at a 
time, and first I check what is really possible or not.

Sam.

Le jeudi 10 avril 2014 19:22:44 UTC+2, Kevin Ingwersen a écrit :
>
> Well, what are you expecting in an empty this object? XD You have nothing 
> assigned to it! Therefore, it will stay empty. Again, check the v8 docs and 
> look for v8::Script, which esentialy is what oyu want; it lets you run 
> arbitary JS code. But to be honest, I would not do this. Consider the 
> binary functions as access into the low level, and try to write as much as 
> you can via JavaScript. If you wish to use data from an existing object, 
> you could end up writing something like this?
>

 

> [....]
>

-- 
-- 
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

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to