This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
First, I could not test NB7.0-Beta, because it only produced errors in a while(true) kind of loop that I was unable to break out of (whenever I closed an error window it would just pop up fresh). The issue: There is only very incomplete code folding for Javascript function expressions. What works: var o = { func1: function () { ... }, func2: function () { ... } } Code folding is provided at both func1 and func2. What doeesn't work: var func1 = function () { ... }; There is no folding! Also, for ANY other place where there are function expressions (i.e. functions with no name as in "function NAME () {}") no code folding is offered! However, function expressions are VITAL for programming in JS. It is not acceptable to have to provide a name only because Netbeans otherwise doesn't provide folding. Thanks!!! PS: The complete background for Javascript function expressions vs. function declarations: - http://dmitrysoshnikov.com/ecmascript/chapter-5-functions/ - http://kangax.github.com/nfe/
UPDATE: I forgot to mention the most important reason besides "looks" why being forced to name functions in function expressions is the buggy implementation of this case in IE - see the first provided URL for a description. In essence, I have to live without folding or may have to live with serious side effects when the code runs in IE.
I am confused why netbeans in version 7 still doesn't support jQuery... specially for code folding... I have code snippets like this... $('#something').click(function(e)){ .... }); and of course I'd like my code to be folded, so it would be more readable... I also tried with cosum fold tags like `//<editor-fold defaultstate="collapsed" desc="el click"> .... //</editor-fold>` that strangly doesn't work in javascript (only in java I suppose)... same thing goes for JS singletons... Please advise, how can I fold some snippets in JS with netbeans just to be clear, I already activated all options in NB settings for code folding(In reply to comment #0) > First, I could not test NB7.0-Beta, because it only produced errors in a > while(true) kind of loop that I was unable to break out of (whenever I closed > an error window it would just pop up fresh). > > > The issue: There is only very incomplete code folding for Javascript function > expressions. > > What works: > > var o = { > func1: function () { > ... > }, > func2: function () { > ... > } > } > > Code folding is provided at both func1 and func2. > > What doeesn't work: > > var func1 = function () { > ... > }; > > There is no folding! Also, for ANY other place where there are function > expressions (i.e. functions with no name as in "function NAME () {}") no code > folding is offered! > > However, function expressions are VITAL for programming in JS. It is not > acceptable to have to provide a name only because Netbeans otherwise doesn't > provide folding. > > Thanks!!! > > > PS: The complete background for Javascript function expressions vs. function > declarations: > - http://dmitrysoshnikov.com/ecmascript/chapter-5-functions/ > - http://kangax.github.com/nfe/ (In reply to comment #0) > First, I could not test NB7.0-Beta, because it only produced errors in a > while(true) kind of loop that I was unable to break out of (whenever I closed > an error window it would just pop up fresh). > > > The issue: There is only very incomplete code folding for Javascript function > expressions. > > What works: > > var o = { > func1: function () { > ... > }, > func2: function () { > ... > } > } > > Code folding is provided at both func1 and func2. > > What doeesn't work: > > var func1 = function () { > ... > }; > > There is no folding! Also, for ANY other place where there are function > expressions (i.e. functions with no name as in "function NAME () {}") no code > folding is offered! > > However, function expressions are VITAL for programming in JS. It is not > acceptable to have to provide a name only because Netbeans otherwise doesn't > provide folding. > > Thanks!!! > > > PS: The complete background for Javascript function expressions vs. function > declarations: > - http://dmitrysoshnikov.com/ecmascript/chapter-5-functions/ > - http://kangax.github.com/nfe/