added status
This commit is contained in:
commit
62c3c3f766
8 changed files with 24 additions and 8 deletions
Binary file not shown.
Binary file not shown.
|
@ -91,11 +91,7 @@ code_change(_OldVsn, State, _Extra) ->
|
|||
%%-----------------------------------------------------
|
||||
|
||||
do_JSCall(Socket, Data) ->
|
||||
io:format("Data: ~p", [Data]),
|
||||
Port = js_runner:boot(),
|
||||
Ret = js_runner:executeJS(Port, Data),
|
||||
gen_tcp:send(Socket, io_lib:fwrite("~p~n", [Ret])).
|
||||
|
||||
args_to_terms(RawArgs) ->
|
||||
{ok, Toks, _Line} = erl_scan:string("[" ++ RawArgs ++ "]. ", 1),
|
||||
{ok, Args} = erl_parse:parse_term(Toks),
|
||||
Args.
|
||||
|
|
|
@ -8,4 +8,4 @@ boot() ->
|
|||
|
||||
executeJS(Port, Data) ->
|
||||
ok = js:define(Port, <<"function helloworld(name){return 'Hello, ' + name}">>),
|
||||
js:call(Port, <<"helloworld">>, [Data]).
|
||||
js:call(Port, <<"helloworld">>, [list_to_binary(Data)]).
|
||||
|
|
Reference in a new issue