title: Node.js bug ? function's return value change when stored as variable
body: <p>Well, I won't talk much...
  I've been using node.js as a WebSocket server, and I've got this <em>problem?</em> :
  <a href="https://i.stack.imgur.com/CtaJH.png" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p>(expected output is: 'works here')</p>
  
  <p>Here are the lines that do this :
  <a href="https://i.stack.imgur.com/v1i9O.png" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p>More images :<a href="https://i.stack.imgur.com/7OZe0.png" rel="nofollow noreferrer">enter image description here</a>
  (expected output is : 'works')</p>
  
  <p>I mean, when the value is stored as a variable, it changes ??
  Is that some kind of bug in nodeJS or v8 engine ??
  (probably , it's 99% i'm wrong ;)</p>
  
  <p>Here's the function's source :</p>
  
  <pre><code>websocket.prototype.decodeWebSocketMessage = function decodeWebSocketMessage(native_data){
  var message = native_data;//data.slice(start, end);
  var FIN = (message[0] &amp; 0x80);
  var RSV1 = (message[0] &amp; 0x40);
  var RSV2 = (message[0] &amp; 0x20);
  var RSV3 = (message[0] &amp; 0x10);
  var Opcode = message[0] &amp; 0x0F;
  var mask = (message[1] &amp; 0x80);
  var length = (message[1] &amp; 0x7F);
  var nextByte = 2;
  if (length === 126) {// length = next 2 bytes
      nextByte += 2;
  } else if (length === 127){// length = next 8 bytes
      nextByte += 8;
  }
  
  var maskingKey = null;
  if (mask){
      maskingKey = message.slice(nextByte, nextByte + 4);
      nextByte += 4;
  }
  
  var payload = message.slice(nextByte, nextByte + length);
  
  if (maskingKey){
      for (var i = 0; i &lt; payload.length; i++){
          payload[i] = payload[i] ^ maskingKey[i % 4];
      }
  }
  return payload.toString().split("\n")[0];
  </code></pre>
  
  <p>}</p>