节点无法启用和声功能

Mar*_*nas 5 node.js ecmascript-harmony ecmascript-6

尝试运行这些新功能,如http://h3manth.com/new/blog/2013/es6-on-nodejs/所示,特别是本地节点环境中的Generators.我node --harmony --use-strict es6.js在0.11.4之前运行任何Node版本的任何原因我得到了错误

function *Counter() {
     ^
SyntaxError: Unexpected token *
etc...
Run Code Online (Sandbox Code Playgroud)

它适用于0.11.4及之后的任何版本,但是当--debug-brk我在那里添加一个语句时

global.v8debug.Debug.setBreakPoint(compiledWrapper, 0, 0);
                       ^
ReferenceError: break_point is not defined
Run Code Online (Sandbox Code Playgroud)

不知道为什么它给了我启用和声的选项,但没有在以前的版本中使用它,为什么我不能调试更高版本?

nga*_*ull 0

--harmony-generators已在 Node v0.11 中添加,这肯定是您的代码无法解析的原因。

中断调试--use-strict是一个问题,因为现在刚刚修复的是节点 v0.12 开发分支

如果您想从最新源构建自己的节点版本,您应该能够调试您的生成器!

来源: https: //github.com/joyent/node/issues/8685