devinus / execjs

Run JavaScript code from Elixir
https://github.com/devinus/execjs
Creative Commons Zero v1.0 Universal
151 stars 22 forks source link

Console.log doesn't work #6

Open pytong opened 8 years ago

pytong commented 8 years ago

Adding console.log to the javascript breaks the code.

function update(request) { console.log("testing"); return request; }

[error] GenServer #PID<0.407.0> terminating \ (Poison.SyntaxError) Unexpected token: t (poison) lib/poison/parser.ex:56: Poison.Parser.parse!/2 (poison) lib/poison.ex:83: Poison.decode!/2 lib/execjs.ex:69: Execjs.extract_result/1 lib/execjs.ex:40: Execjs.exec/1

What am I missing here?

korczis commented 8 years ago

@devinus Any plans to address this issue?

devinus commented 8 years ago

@pytong @korczis The console object should not be available at all in any environemtn. Is this the Node runner?