Bug 144309
| Summary: | Web Inspector: Exception under ObjectTreeView.js on specific code.tutsplus.com page | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Timothy Hatcher <timothy> |
| Component: | Web Inspector | Assignee: | Joseph Pecoraro <joepeck> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | ggaren, graouts, joepeck, jonowells, mattbaker, nvasilyev, timothy, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | 528+ (Nightly build) | ||
| Hardware: | All | ||
| OS: | All | ||
| URL: | http://code.tutsplus.com/tutorials/say-hello-to-webkit-filters--net-23318 | ||
Timothy Hatcher
Load http://code.tutsplus.com/tutorials/say-hello-to-webkit-filters--net-23318 with the Inspector open. Didn't do anything special.
TypeError: null is not an object (evaluating 'a.match(chunk)')
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
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/20721693>
Joseph Pecoraro
I don'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'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 && b)
return -1;
if (!b && 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 && !bnum)
return -1;
if (bnum && !anum)
return 1;
// 4. Number differences, if the same we continue.
if (anum && bnum) {
diff = chunka - chunkb;
if (diff === 0 && chunka.length !== chunkb.length) {
if (!+chunka && !+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 < 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 "a" be null then, I think something must have gone wrong.
I believe Geoff just re-wrote Array.prototype.sort, so maybe that is related?
Joseph Pecoraro
Tim, it looks like Geoff'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?
Timothy Hatcher
I had Geoff's change at the time. Rebuilding to see if it is better.
Timothy Hatcher
Looks fine now.
Geoffrey Garen
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 'b.resource.type')
"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"
_dispatchEventMain.js:687:105
dispatchMain.js:651
dispatchNextQueuedMessageFromBackend
Timothy Hatcher
Geoff, was that loading the same page linked above?
Geoffrey Garen
(In reply to comment #7)
> Geoff, was that loading the same page linked above?
Yeah, same page.
Timothy Hatcher
Seems to be fine.(In reply to comment #8)
> (In reply to comment #7)
> > Geoff, was that loading the same page linked above?
>
> Yeah, same page.
Filed new bug about that. Bug 147451.