title: Chrome Dev Tools not recognizing a function under Watches
body: <p>I am coming across a very strange problem with Chrome Dev tools. My browser version is 57.0.2987.133 (64-bit), which is the latest version.</p>
  
  <p>I am debugging a script that contains a function <code>validatePositiveIntegerValue</code> but it's saying under watch <code>&lt;not available&gt;</code> for a watch expression using this function. But, if I use <code>validateIntegerValue("23.34")</code> then it recognizes the function and shows a value. So I am very confused why some methods are being recognized and some are not, even when they are defined within the same block.</p>
  
  <p>I did try to render the page in an incognito window and also pressed Ctrl + Shift + R to refresh scripts, but it did nothing.</p>
  
  <p><strong>Question</strong></p>
  
  <p>Why is the function <code>validatePositiveIntegerValue</code> that exists not being recognized by a watch expression, but <code>validatePositiveValue</code> that is defined within the same block is being recognized by a watch expression?</p>
  
  <p><strong>Script Window in Chrome Dev Tools</strong>
  <a href="https://i.stack.imgur.com/jMykW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jMykW.png" alt="Chrom Dev Tools Script Window"></a></p>
  
  <p><strong>Watch Expression in Chrome Dev Tools</strong></p>
  
  <p>[<img src="https://i.stack.imgur.com/tBQK0.png" alt="Chrome Dev Tools Watch Expression Problem[3]"></p>
  
  <p><strong>HOW TO REPRODUCE this issue</strong></p>
  
  <p>The closest I could get to reproducing this issue is by running the below html file in Chrome. Then, when I click on either of the 2 buttons, and break within <code>doSomething</code> method within <code>myValidation</code>, I cannot evaluate this watch expression <code>validatePositiveIntegerValue("23.sd")</code>.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;head&gt;
  &lt;title&gt;Chrome Dev Tools Issue&lt;/title&gt;
  &lt;script&gt;
  function doSomething1() {
    alert("hi 1");
    var isvalid =rpv.validateIntegerValue("dsdsd");
  }
  
  function doSomething2() {
    alert("hi 2");
     var isvalid = rpv.validateIntegerValue("dsdsd");
  }
  
  
  function myValidation() {
    var eo = {};
  
    eo.validateIntegerValue = function(integerValue) {
      doSomething();
      if (!integerValue) {
        return false;
      }
      if (isNaN(integerValue) === true) {
        return false;
      }
      return parseInt(integerValue).toString() === $.trim(integerValue.toString());
    }
     function validatePositiveIntegerValue(integerValue) {
      if (!integerValue) {
        return false;
      };
      if (isNaN(integerValue) === true) {
        return false;
      }
      return parseInt(integerValue).toString() === $.trim(integerValue.toString()) &amp;&amp; parseInt(integerValue) &gt;= 0;
    }
    function doSomething() {
       var x = 20;
     }
  
    function validateNegativeIntegerValue(integerValue) {
      if (!integerValue) {
        return false;
      };
      if (isNaN(integerValue) === true) {
        return false;
      }
      return parseInt(integerValue).toString() === $.trim(integerValue.toString()) &amp;&amp; parseInt(integerValue) &lt; 0;
    }
  
    function validatePositiveOrZeroIntegerValue(integerValue) {
      if (!integerValue) {
        return false;
      };
      if (isNaN(integerValue) === true) {
        return false;
      }
      return parseInt(integerValue).toString() === $.trim(integerValue.toString()) &amp;&amp; parseInt(integerValue) &gt; 0;
    }
  
    return eo;
  
  }
  
  var rpv = myValidation();
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  Chrome Dev Tools Issue with Watch Expression not recognising a function
  &lt;button id="btn1" onclick="doSomething1();return false;"&gt;Call doSomething1 method&lt;/button&gt;
  &lt;button id="btn1" onclick="doSomething2();return false;"&gt;Call doSomething2 method&lt;/button&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I have created a Chrome bug at following url: <a href="https://bugs.chromium.org/p/chromium/issues/detail?id=708459#" rel="nofollow noreferrer">Chrome Bug Item</a></p>