Eclipse中的JS代码折叠错误?

1wnzp6jl  于 2022-12-03  发布在  Eclipse
关注(0)|答案(1)|浏览(106)

我有这个密码

/**
* @file core.js 
* @brief this file contains the basics of the frame work 
*
* @author David Garcia
*
* @date 11/08/1983
*/
(function(){

    window.onerror = function (sMessage, sUrl, sLine) {
        alert("An error occurred at " + sUrl + "\nLine Number: " + sLine + '\n\n' + sMessage);
        return true;
    };

    /**
     * IE fix
     */
    function ieFix(){
        if(typeof window.XMLHttpRequest === 'undefined' &&
            typeof window.ActiveXObject === 'function') {
            window.XMLHttpRequest = function() {
                try { return new ActiveXObject('Msxml2.XMLHTTP.6.0'); } catch(e) {}
                try { return new ActiveXObject('Msxml2.XMLHTTP.3.0'); } catch(e) {}
                return new ActiveXObject('Microsoft.XMLHTTP');
            };
        }
    }   
})();

我不能折叠(折叠)注解和函数,但如果我使用以下代码:

/**
    * @file core.js 
    * @brief this file contains the basics of the frame work 
    *
    * @author David Garcia
    *
    * @date 11/08/1983
    */

window.onerror = function (sMessage, sUrl, sLine) {
            alert("An error occurred at " + sUrl + "\nLine Number: " + sLine + '\n\n' + sMessage);
            return true;
        };

        /**
         * IE fix
         */
        function ieFix(){
            if(typeof window.XMLHttpRequest === 'undefined' &&
                typeof window.ActiveXObject === 'function') {
                window.XMLHttpRequest = function() {
                    try { return new ActiveXObject('Msxml2.XMLHTTP.6.0'); } catch(e) {}
                    try { return new ActiveXObject('Msxml2.XMLHTTP.3.0'); } catch(e) {}
                    return new ActiveXObject('Microsoft.XMLHTTP');
                };
            }
        }

是错误或配置错误。
Eclipse版本:靛蓝服务版本1。内部版本ID:20110916-0149。插件:Javascript集成开发环境1.4.1.20110303-1818

相关问题