title: Why setInterval accepts only 2^31-1 delay values?
body: <p>According to the <a href="https://www.w3.org/TR/html5/webappapis.html#timers" rel="nofollow">specification</a>,</p>
  
  <pre><code>long setInterval(Function handler, optional long timeout, any... arguments);
  </code></pre>
  
  <p><code>setInterval()</code> is supposed to accept <code>long</code> timeout delay.</p>
  
  <p>However, on 64bit Linux it behaves like it was a signed 32bit int.
  I didn't test on other platforms, <a href="http://jsbin.com/pefizozeci/edit?js,console" rel="nofollow">please try</a> and leave a comment.</p>
  
  <p>The obvious question is - <em>Why</em>?</p>
  
  <p>Can someone explain <strong>why do I get instantly output</strong> of this:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="true">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>let maxSigned32 = 2147483647;
  let safeInt = maxSigned32 + 1;
  
  console.log(safeInt);
  console.log(Number.MAX_SAFE_INTEGER);
  console.log(safeInt &lt; Number.MAX_SAFE_INTEGER); // true
  
  let days = Math.round(safeInt / (1000.0 * 60 * 60 * 24));
  
  console.log(safeInt + ' ms is ~' + days + ' days');
  
  setTimeout(() =&gt; {
    console.log('I should not see this today')
  }, safeInt);</code></pre>
  </div>
  </div>
  </p>
  
  <p>I get this (incorrect?) results both on Chrome 52 and Firefox 48.
  Interestingly, when I built and tried with latest ChakraCore, it behaves more reasonable.</p>