Does a "...used out of scope." error in KSLint cause a '[1] is null or not an object' error?
<p>I am attempting to use JavaScript to populate a drop-down list and am getting the following error in IE8:</p>

<p>Message: '1' is null or not an object
Line: 59
Char: 3
Code: 0</p>

<p>When I push the code through a debugger (In this case, JSBin), I see the following error in the code:</p>

<p>Line 59: var $selected_view = $( '#ai1ec-view-' + matches[1] ); --- 'matches' used out of scope.</p>

<p>Would this error in JSBin correlate to the error in IE8?  When the code runs on Chrome, FF, or IE9, the error does not populate whatsoever.</p>

<p>Here is a snippet of the code in question.</p>

<pre><code>// Make current view actively selected in view dropdown button.
    var classes = $('body').attr( 'class' ).split( ' ' );
    for ( i in classes ) {
        // Extract current view from the body class.
        var matches = /ai1ec-action-([\w]+)/.exec( classes[i] );
        if ( matches != null ) break;
    }
    // Get the dropdown menu link of the active view.
    var $selected_view = $( '#ai1ec-view-' + matches[1] );
    // Replace contents of dropdown button with menu link, plus the caret.
    $( '#ai1ec-current-view' )
        .contents()
            .remove()
            .end()
        .prepend( $selected_view.contents().clone() )
        .append( '&lt;span class="caret"&gt;&lt;/span&gt;' );
    // Deactivate all dropdown menu items.
    $( '#ai1ec-view-dropdown .dropdown-menu li' ).removeClass( 'active' );
    // Activate only currently selected dropdown menu item.
    $selected_view.parent().addClass( 'active' );
</code></pre>
