Skip to content

Commit

Permalink
Extending timeout on Javascript calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Smith committed Dec 10, 2010
1 parent 532abea commit b409f2b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/js.erl
Expand Up @@ -40,7 +40,7 @@ define(Ctx, Js, Bindings) ->
%% @spec eval(port(), binary()) -> {ok, any()} | {error, any()}
%% @doc Evaluate one or more Javascript expressions and return the results
eval(Ctx, Js) ->
js_driver:eval_js(Ctx, Js).
js_driver:eval_js(Ctx, Js, 30000).

%% @spec call(port(), binary(), list(any())) -> {ok, Result} | {error, any()}
%% @doc Call a function by name with a list of arguments. This is roughly the
Expand All @@ -57,7 +57,7 @@ call(Ctx, FunctionName, Args, Bindings) ->
Js = iolist_to_binary([<<"function() {">>, JsBindings, <<" if (">>, FunctionName, <<" === undefined) { throw(\"">>,
FunctionName, <<" not defined\"); } ">>,
<<"return ">>, FunctionName, <<"(">>, ArgList, <<");">>, <<"}();">>]),
js_driver:eval_js(Ctx, Js).
js_driver:eval_js(Ctx, Js, 30000).

%% Internal functions
build_bindings([], Accum) ->
Expand Down

0 comments on commit b409f2b

Please sign in to comment.