2015-08-25 114 views
1

首先,我使用--harmony標誌啓動Node。我在Eclipse中設置了這個標誌「Preferences> Nodeclipse> node options」Nodeclipse無法識別生成器函數

問題顯示在.js文件中。

舉例來說,我在我的控制器中的一個發電機方法...

show: function*() { ... } 

Nodeclipse正顯示出與發電機功能的所有.js文件錯誤。 它顯示紅色的「X」與消息...

Syntax error on "*". Delete this token. 

由於大部分的節點模塊我使用有發電機的功能,我有這樣的項目500錯誤。

任何人都知道如何解決這個問題?

+0

查看https://github.com/Nodeclipse/nodeclipse-1/issues/194 –

回答

1

一個)得到Nodeclipse 1.1 http://www.nodeclipse.org/history

b)中手動執行:

除去JSDT性質中的.project

<nature>org.eclipse.wst.jsdt.core.jsNature</nature> 

在.jshintrc使ES6

"esnext" : true, // Allow ES.next (ECMAScript 6) specific features such as `const` and `let`.