2013-03-29 59 views
4

我遇到了一个Eclipse折叠JavaScript代码不正确的问题,我不知道是什么问题。我在建立一个游戏引擎的过程,所以我有一个特定的对象的构造函数,然后函数计算帧率:代码折叠问题eclipse

function Constructor() { 
    //A whole bunch of code for this constructor 

    this.method = function() { 
     //A bunch of method code 
     this.context.font = "blahblah"; 
    }; 
} 

function calculateFrameRate(times) { 
    //All the code for calculating framerate 
} 

无论出于何种原因,它给我折的选项开始在context.font声明,并通过帧率计算函数一路崩溃。这显然不是有效的代码块崩溃。关于问题可能是什么的任何想法?

+0

这是Eclipse的JavaScript编辑器中的错误。你的代码没有错。 – techfoobar

回答

0

尝试this.method = function() {命名的功能是类似this.method = function method() {