Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

JavaScript Why does console.log not work everywhere?

vmprog

New Coder
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

JavaScript:
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");
 
The issue here is that we have only part of the code. I don't see where these functions are called. Because, both NetWorkManager4 and NetWorkManager3 are inside the function. So, if the function is not called, of course it won't show.

Another thing that looks odd to me is, when you name variables one after another, you put coma after it, but, after naming h and closing the function, there is no semi-colon. You just skip that part and move on to make new variables. Not sure if that may affect your code working.
 
Back
Top Bottom