我试图在最新构建的ES6 (v2.0.2)和OSX上测试箭头函数、类和模块等io.js特性。我跑
iojs [filename].js --es_staging --harmony_modules --harmony_arrow_functions但我收到的抱怨就像
import _ from 'underscore';
^^^^^^
SyntaxError: Unexpected reserved word和
setTimeout((arg) => {
^^
SyntaxError: Unexpected token =>我是否没有正确地运行io.js来启用这些特性?
发布于 2015-05-22 23:36:03
D‘噢,该标志需要放在文件名之前,所以运行iojs --harmony_arrow_functions [filename].js是可行的。
https://stackoverflow.com/questions/30406685
复制相似问题