>
> I have the feeling, I am very close to getting this, but I still dont
> fully get how to register a C function to be called when a JS function
> is called.
>
> - Jak
>From shell.cc:
v8::Handle<v8::Value> Version(const v8::Arguments& args) {
return v8::String::New(v8::V8::GetVersion());
}
// Create a template for the global object.
v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New();
// Bind the 'version' function
global->Set(v8::String::New("version"), v8::FunctionTemplate::New(Version));
O.
>
>
> On Jan 18, 7:59 am, Stephan Beal <[email protected]> wrote:
>> On Tue, Jan 18, 2011 at 4:35 PM, Jak Sprats <[email protected]> wrote:
>> > <huge snip>
>>
>> ...man-days embedding V8 and then using v8-juice to implement the JS func
>>
>> > "client" would take? (just ballpark: is it a day, a week, a month?)
>>
>> i couldn't even guess. AlchemyDB and reddit are both foreign words to me, so
>> i couldn't even venture a guess.
>>
>> > What would be REAL helpful is if there was a hello-world for embedding
>> > v8 in C
>>
>> There is a hello-world (the shell app) in the v8 source tree. Binding that
>> with C requires a C++ middle-man API which has functions the C code can call
>> (i.e. they use export "C"). Aside from that, there should be no magic
>> involved.
>>
>> If all you want to do is wrap a single function, an add-on library like
>> v8-juice or vu8 is way overkill. i'd start by taking a look at shell.cc in
>> the v8 source tree.
>>
>> --
>> ----- stephan bealhttp://wanderinghorse.net/home/stephan/
>
> --
> v8-users mailing list
> [email protected]
> http://groups.google.com/group/v8-users
--
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users