I am wondering how the sequence shown below can happen.
Here is the function:
WebSocketConnector.prototype.sendMessage = function(message) { if (socket !== null) { socket.send(message); console.log('Sent: ' + message); } else { alert('Failed to send message. WebSocket connection not established.'); } };
And this is what happens when I debug this function call:
1. Start at line 32.

2. Step In, advancing to line 33.

3. Step Again, advancing to line 34.

4. A step at a time, advancing to line 36 ???

→ How can I control, perhaps go directly from the last line of the if block to the first line of the else block?
Some important facts:
- There are no missing steps.
- It really happened.
- I only call
sendMessage from one place, and I log in with this call. There are no unrecorded sendMessage calls in the sendMessage , so I do not believe that asynchrony is an explanation. - I also tried the same thing with the Firebug debugger, and the same crazy thing happens.
Edit / Followup
If I add the console.log statement to the first line of the else block (by clicking the warning to line 37), the control will go straight from line 34 to line 37 (skipping the console.log statement).
Also, I should have mentioned that no warnings actually ever appear, even when they go directly to this code.
Edit 2
Here is the interval and CRLF of the sendMessage function:

source share