<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>144309</bug_id>
          
          <creation_ts>2015-04-27 19:51:03 -0700</creation_ts>
          <short_desc>Web Inspector: Exception under ObjectTreeView.js on specific code.tutsplus.com page</short_desc>
          <delta_ts>2015-07-30 11:44:52 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Inspector</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://code.tutsplus.com/tutorials/say-hello-to-webkit-filters--net-23318</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Timothy Hatcher">timothy</reporter>
          <assigned_to name="Joseph Pecoraro">joepeck</assigned_to>
          <cc>ggaren</cc>
    
    <cc>graouts</cc>
    
    <cc>joepeck</cc>
    
    <cc>jonowells</cc>
    
    <cc>mattbaker</cc>
    
    <cc>nvasilyev</cc>
    
    <cc>timothy</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1089347</commentid>
    <comment_count>0</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2015-04-27 19:51:03 -0700</bug_when>
    <thetext>Load http://code.tutsplus.com/tutorials/say-hello-to-webkit-filters--net-23318 with the Inspector open. Didn&apos;t do anything special.

TypeError: null is not an object (evaluating &apos;a.match(chunk)&apos;)
comparePropertyDescriptors@file:///Users/Timothy/Work/Safari-TOT.git/OpenSource/WebKitBuild/Release/WebInspectorUI.framework/Resources/Views/ObjectTreeView.js:134:29
sort@[native code]
_updateProperties@file:///Users/Timothy/Work/Safari-TOT.git/OpenSource/WebKitBuild/Release/WebInspectorUI.framework/Resources/Views/ObjectTreeView.js:287:24
_updateChildren@file:///Users/Timothy/Work/Safari-TOT.git/OpenSource/WebKitBuild/Release/WebInspectorUI.framework/Resources/Views/ObjectTreeView.js:257:21
_updateChildren@[native code]
_getPropertyDescriptorsResolver@file:///Users/Timothy/Work/Safari-TOT.git/OpenSource/WebKitBuild/Release/WebInspectorUI.framework/Resources/Protocol/RemoteObject.js:510:17
_getPropertyDescriptorsResolver@[native code]
_dispatchCallback@file:///Users/Timothy/Work/Safari-TOT.git/OpenSource/WebKitBuild/Release/WebInspectorUI.framework/Resources/Protocol/InspectorBackend.js:181:31
dispatch@file:///Users/Timothy/Work/Safari-TOT.git/OpenSource/WebKitBuild/Release/WebInspectorUI.framework/Resources/Protocol/InspectorBackend.js:86:35
dispatchNextQueuedMessageFromBackend@file:///Users/Timothy/Work/Safari-TOT.git/OpenSource/WebKitBuild/Release/WebInspectorUI.framework/Resources/Protocol/MessageDispatcher.js:42:34
file:///Users/Timothy/Work/Safari-TOT.git/OpenSource/WebKitBuild/Release/WebInspectorUI.framework/Resources/Controllers/FormatterContentBuilder.js:156:23: CONSOLE ERROR</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1089349</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2015-04-27 19:51:37 -0700</bug_when>
    <thetext>&lt;rdar://problem/20721693&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1089369</commentid>
    <comment_count>2</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2015-04-27 20:34:54 -0700</bug_when>
    <thetext>I don&apos;t understand how this is possible.

Here is the code, annotated with some comments.

        ...

        // By this point, a and b should be strings. If they aren&apos;t something else went wrong in surrounding code.

        // 1. Rule out equivalent names.
        if (a === b)
            return 0;

        while (diff === 0) {

            // 2. Rule out one being shorter then the other.
            if (!a &amp;&amp; b)
                return -1;
            if (!b &amp;&amp; a)
                return 1;

            chunka = a.match(chunk)[0];
            chunkb = b.match(chunk)[0];
            anum = !isNaN(chunka);
            bnum = !isNaN(chunkb);

            // 3. Number versus non number cases.
            if (anum &amp;&amp; !bnum)
                return -1;
            if (bnum &amp;&amp; !anum)
                return 1;

            // 4. Number differences, if the same we continue.
            if (anum &amp;&amp; bnum) {
                diff = chunka - chunkb;
                if (diff === 0 &amp;&amp; chunka.length !== chunkb.length) {
                    if (!+chunka &amp;&amp; !+chunkb) // chunks are strings of all 0s (special case)
                        return chunka.length - chunkb.length;
                    else
                        return chunkb.length - chunka.length;
                }
            }
            
            // 5. Different strings
            else if (chunka !== chunkb)
                return (chunka &lt; chunkb) ? -1 : 1;

            // 6. Proceed to the next part of the string.
            a = a.substring(chunka.length);
            b = b.substring(chunkb.length);

        }

        ...


For us to have encountered a.match(chunk) and have &quot;a&quot; be null then, I think something must have gone wrong.

I believe Geoff just re-wrote Array.prototype.sort, so maybe that is related?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1089372</commentid>
    <comment_count>3</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2015-04-27 20:37:48 -0700</bug_when>
    <thetext>Tim, it looks like Geoff&apos;s sort changes (r183288) got rolled out a bit later (r183308). My ToT (r183442) was not encountering the issue. Do you know what r### your JavaScriptCore was?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1089568</commentid>
    <comment_count>4</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2015-04-28 09:50:10 -0700</bug_when>
    <thetext>I had Geoff&apos;s change at the time. Rebuilding to see if it is better.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1089664</commentid>
    <comment_count>5</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2015-04-28 12:15:01 -0700</bug_when>
    <thetext>Looks fine now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1090233</commentid>
    <comment_count>6</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2015-04-29 16:55:26 -0700</bug_when>
    <thetext>I see this in TOT, and in 183568, just before the Array.prototype.sort patch re-landed: 

Uncaught exception in inspector page while handling event Network.responseReceived:  (2)
TypeError: undefined is not an object (evaluating &apos;b.resource.type&apos;)
&quot;compareResourceTreeElements@Main.js:6957:63
compareFolderAndResourceTreeElements@Main.js:6968:114
value@Main.js:516:107
insertionIndexForObjectInListSortedByFunction@Main.js:535:96
descendantResourceTreeElementTypeDidChange@Main.js:6825:240
callFirstAncestorFunction@Main.js:6238:130
_typeDidChange@Main.js:6992:112
dispatch@Main.js:100:158
dispatchEventToListeners@Main.js:102:9
updateForResponse@Main.js:3576:30
resourceRequestDidReceiveResponse@Main.js:14444:51
responseReceived@Main.js:797:69
dispatchEvent@Main.js:723:34
_dispatchEvent@Main.js:687:55
dispatch@Main.js:651:20
dispatchNextQueuedMessageFromBackend@Main.js:786:32&quot;
_dispatchEventMain.js:687:105
dispatchMain.js:651
dispatchNextQueuedMessageFromBackend</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1090776</commentid>
    <comment_count>7</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2015-05-01 07:49:54 -0700</bug_when>
    <thetext>Geoff, was that loading the same page linked above?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1090836</commentid>
    <comment_count>8</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2015-05-01 11:41:51 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; Geoff, was that loading the same page linked above?

Yeah, same page.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1113448</commentid>
    <comment_count>9</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2015-07-30 11:44:52 -0700</bug_when>
    <thetext>Seems to be fine.(In reply to comment #8)
&gt; (In reply to comment #7)
&gt; &gt; Geoff, was that loading the same page linked above?
&gt; 
&gt; Yeah, same page.

Filed new bug about that. Bug 147451.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>