Javascript 代码折叠问题

Javascript 代码折叠问题,javascript,eclipse,collapse,folding,Javascript,Eclipse,Collapse,Folding,我遇到了Eclipse错误折叠javascript代码的问题,我不知道问题出在哪里。我正在构建一个游戏引擎,因此我有一个特定的对象构造函数,后跟一个计算帧率的函数: function Constructor() { //A whole bunch of code for this constructor this.method = function() { //A bunch of method code this.context.font =

我遇到了Eclipse错误折叠javascript代码的问题,我不知道问题出在哪里。我正在构建一个游戏引擎,因此我有一个特定的对象构造函数,后跟一个计算帧率的函数:

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语句开始折叠的选项,并且它一直折叠到framerate计算函数。这显然不是要折叠的有效代码块。关于问题可能是什么,你有什么想法吗?

试着在
this.method=function(){
中将函数命名为类似
this.method=function method(){

这是eclipse JavaScript编辑器中的一个错误。你的代码没有错。