Why does console.log not work everywhere?

Hello.
Why do I only see in the console:
jswrapper: JS: my debug network manager 1
jswrapper: JS: my debug network manager 2
And I don’t see:
jswrapper: JS: my debug NetworkManager 3
jswrapper: JS: my debug NetworkManager 4

          n.NetWorkManager = void 0;      
          console.log("my debug NetWorkManager1");
          var a = cc._decorator,
              s = a.ccclass,
              l = e("../../common/ecdh/ecdhHandler"),
              d = e("../../components/game/humanboy/HGameScene"),
              f = e("../../../../pkf/script/common/config/PKFConfig"),
              h = function(e) {
                  i(t, e);
                  console.log("my debug NetWorkManager2");
                  function t() {
                      console.log("my debug NetWorkManager3");
                      var t = null !== e && e.apply(this, arguments) || this;
                      t._isswitchServer = !1;         
                      return t;
                  }
                  n = t;
                  t.getInstance = function() {    
                      console.log("my debug NetWorkManager4");
                      if (!this._g_instance) {        
                         this._g_instance = new n();     
                         this._g_instance.init();        
                     }
                     return this._g_instance;
                  };
                  t.prototype.init = function() {
                      console.log("my debug NetWorkManager5");

console.log will be executed only when the functions are called. In your case, t() and t.getInstance().

Share complete codes.

1 Like