title: Why is Minified Code not Equivalent to Original?
body: <p>When I ran my MVC 4 project in Release mode, one page that uses <a href="https://github.com/mleibman/SlickGrid" rel="nofollow noreferrer">SlickGrid</a> did not display correctly (the grid is very, very tall and the grid cells are missing).</p>
  
  <p>However, I do not think this is an issue of SlickGrid, but rather of how the bundler (<code>System.Web.Optimization</code> that is integrated into MVC 4) minified the code.</p>
  
  <p>I grabbed the minified JavaScript and began reversing minification in one area at a time until the problem was fixed.  I found that changing (and forgive the scrolling, I want to leave the minified version exactly as-is)</p>
  
  <pre><code>function SlickFilter(n,t){var i=n.option,r=t.searchString;return n.pctSortKey.key&lt;t.percentCompleteThreshold||r!=""&amp;&amp;i.indexOf(r)==-1&amp;&amp;i!="Unweighted Response"&amp;&amp;i!="Median"&amp;&amp;i!="Average"?!1:!0}
  </code></pre>
  
  <p>to the original</p>
  
  <pre><code>function SlickFilter(item, args) {
      if (item.pctSortKey.key &lt; args.percentCompleteThreshold) {
          return false;
      }
  
      if (args.searchString != "" &amp;&amp; item.option.indexOf(args.searchString) == -1 &amp;&amp; item.option != "Unweighted Response" &amp;&amp; item.option != "Median" &amp;&amp; item.option != "Average") {
          return false;
      }
  
      return true;
  }
  </code></pre>
  
  <p>resolves the issue if all other elements of the minified file are unchanged.</p>
  
  <p>The function is used like:</p>
  
  <pre><code>dataView.setFilter(SlickFilter);
  </code></pre>
  
  <p>to provide a callback function for SlickGrid to filter out certain results.</p>
  
  <p>How is it that the original and the minified function are not equivalent?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>SlickGrid is "compiling" the filter function that I provide.  That compilation step is failing with the minified version.  The compiled minified code looks like:</p>
  
  <pre><code>function anonymous(_items,_args) {
  var _retval = [], _idx = 0; var n,  t = _args; _coreloop: for (var _i = 0, _il = _items.length; _i &lt; _il; _i++) { n = _items[_i]; 
      //debugger;
      var i = n.option,
          r = t.searchString;
  
      return 
      n.pctSortKey.key &lt; t.percentCompleteThreshold 
      || 
      r !="" 
          &amp;&amp; i.indexOf(r)==-1 
          &amp;&amp; i != "Unweighted Response" 
          &amp;&amp; i != "Median"
          &amp;&amp; i != "Average"
  ? !1
  : !0
  ; } return _retval; 
  }
  </code></pre>
  
  <p>Note the multiple <em>return</em> statements.</p>
  
  <p>With this additional insight, I was able to identify a relevant SlickGrid bug:</p>
  
  <p><a href="https://github.com/mleibman/SlickGrid/issues/301" rel="nofollow noreferrer">https://github.com/mleibman/SlickGrid/issues/301</a></p>