在运行node debug file.js时,您应该能够调用list来显示正在执行的行以及它周围的行。当我这么做的时候,我得到的只是[Function],为什么呢?
debug> list
[Function]下面是我刚刚尝试调试的一个示例文件:
const h = require('virtual-dom/h');
const toHTML = require('vdom-to-html');
var tree = h('input', { type: 'submit', value: 'Add' });
var str = toHTML(tree);无论我在哪里尝试“列表”,它都是[Function]说的。
发布于 2015-04-09 14:00:54
list是调试器中的一个函数。它输出[function]的原因是您没有调用它,而是导致repl返回函数list。
你需要打电话给list()。
例如:
> node debug logger.js
< Debugger listening on port 5858
connecting to port 5858... ok
break in logger.js:1
> 1 'use strict';
2
3 const bunyan = require('bunyan');
debug> list()
> 1 'use strict';
2
3 const bunyan = require('bunyan');
4
5 /**
6 * Returns a configured bunyan logger
debug> list
[Function]
debug>https://stackoverflow.com/questions/28973423
复制相似问题