独立的 V8 shell ( d8
) 没有 console
对象,所以我不能做 console.log
.如何将东西打印到标准输出?
最佳答案
使用 print
函数而不是 console.log
.例如:
$ cat test.js
print('foo');
$ ~/src/v8/out/native/d8 test.js
foo
前往 Sandeep Datta's blog post有关
d8
的更多信息辅助函数如 print
.
关于v8 - 带有独立 V8 (d8) 的 console.log,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22284207/