This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(v8test). | |
-export([run/0]). | |
-include_lib("erlv8/include/erlv8.hrl"). | |
run() -> | |
application:start(erlv8), | |
{ok, VM} = erlv8_vm:start(), | |
Global = erlv8_vm:global(VM), | |
Global:set_value("callback", erlv8_object:new([{"exec", fun (#erlv8_fun_invocation{}, []) -> myCallback() end}])), | |
erlv8_vm:run(VM,"callback.exec();"). | |
myCallback() -> | |
io:format("Hello from myCallback!~n", []), | |
ok. |
Time Report
Jan 26, we had a meeting between 13-15, so 2 hours
I worked with V8 between 00.30-02.00, so 1.5 hours
In total: 3.5 hours.
Yeah, I had major headaches today while I tried to implement exposing our host object to JavaCcript in a good and convinient way.
ReplyDeletettepasse added a link to a example where sone guy uses proxy-inception in Firefox 4 beta (spidermonkey) the way I would like our API to work, it is not implemented in V8 that way (yet).
I read some of ttpasse's second article as well.. Isn't this what we want for V8?
ReplyDeleteOh.. Seems like that was for node.js..
ReplyDeletecan erlv8 run on windows ???
ReplyDelete@john, I didn't encounter any note saying it wouldn't, but I didn't try either. We switched over to erlang_js which uses SpiderMonkey instead and this project explicitly states that erlang_js does not run on windows.
ReplyDelete