Pergunta

The standalone V8 shell (d8) does not come with a console object, so I cannot do console.log. How do I print stuff to stdout?

Foi útil?

Solução

Use the print function instead of console.log. For instance:

$ cat test.js
print('foo');
$ ~/src/v8/out/native/d8 test.js
foo

Head over to Sandeep Datta's blog post for more info on d8 helper functions like print.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top