Created
January 27, 2011 00:54
-
-
Save jonte/797851 to your computer and use it in GitHub Desktop.
v8test.erl
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. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment