How can I view the outline in eclipse when using the revealing module pattern?

后端 未结 4 442
猫巷女王i
猫巷女王i 2020-12-28 17:56

I\'m currently refactoring some Javascript code we have and amongst other things I\'ve changed it to make use of the revealing module pattern. The code is looking much tidie

4条回答
  •  情话喂你
    2020-12-28 18:23

    one way is to call it as below. Define it as it is, but do not self execute it. Ensure the prototype is an empty object and then try calling it. It works the same way, but will restore the outline and you don't need to add comments in front of every function.

    var myNamespace = (function()
    {
      function myFunc1() {}
      function myFunc2() {}
    
      return {
        name: "myNamespace",
        myFunc1: myFunc1,
        myFunc2: myFunc2
      }
    });
    myNamespace.prototype = {};
    myNamespace();
    

提交回复
热议问题