10
出错的行coffeescript:为什么“str”.replace(// g,“”)给coffeescript编译错误?
"str".replace(/ /g, "")
给
Error: In orders.js.erb.coffee, Parse error on line 463: Unexpected 'MATH'
at Object.parseError (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/parser.js:466:11)
at Object.parse (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/parser.js:542:22)
at Object.compile (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:38:22)
at /usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:149:33
at /usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:115:19
at [object Object].<anonymous> (fs.js:107:5)
at [object Object].emit (events.js:61:17)
at afterRead (fs.js:878:12)
at wrapper (fs.js:245:17)
这是CoffeeScript的编译器错误还是我失去了一些东西?
coffeescript文档没有提到需要在正则表达式中跳过空格,这很让人伤心。 – neuronaut 2014-05-21 07:48:41