nodejs v4中默认参数的哪个和声标志

ao

我正在使用node.js v4.0.0,正在尝试使某些代码工作而无需首先进行编译。大多数人都在工作时,我无法使用

import

这可能是由于尚未完成阶段,但我也找不到启用它的标志。我已经尝试了所有这些:

--harmony_modules (enable "harmony modules" (in progress))
  --harmony_array_includes (enable "harmony Array.prototype.includes" (in progress))
  --harmony_regexps (enable "harmony regular expression extensions" (in progress))
  --harmony_proxies (enable "harmony proxies" (in progress))
  --harmony_sloppy (enable "harmony features in sloppy mode" (in progress))
  --harmony_unicode_regexps (enable "harmony unicode regexps" (in progress))
  --harmony_reflect (enable "harmony Reflect API" (in progress))
  --harmony_destructuring (enable "harmony destructuring" (in progress))
  --harmony_sharedarraybuffer (enable "harmony sharedarraybuffer" (in progress))
  --harmony_atomics (enable "harmony atomics" (in progress))
  --harmony_new_target (enable "harmony new.target" (in progress))

(不用说我没有使用正则表达式... :))

虽然我知道了导入的原因,但我不明白为什么默认参数似乎已被终结,而默认参数却失败了,而且我找不到一个似乎可以处理它的标志。

是否有用于导入和默认参数的标志?

无效的代码是

class foo extends bar {
    constructor(options = {})
    ....
}

错误是

意外的=非法令牌

肖恩·维埃拉(Sean Vieira)

节点4使用的是Chrome 45随附的V8版本-V8 v4.5.103.3甚至没有标记也没有默认参数。默认参数包含在Chrome 49随附的V8版本中,并将位于Node 6+中。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章