Summary: | Web Inspector: Properties on Arrays and NodeLists are not logged correctly | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Timothy Hatcher <timothy> | ||||||
Component: | Web Inspector (Deprecated) | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | aroben, joepeck, pfeldman, rik, timothy | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | All | ||||||||
OS: | All | ||||||||
Attachments: |
|
Description
Timothy Hatcher
2009-10-17 14:26:05 PDT
Created attachment 41382 [details]
proposed patch
Adds InjectedScript.getArrayElements to enumerate just the array elements.
Comment on attachment 41382 [details] proposed patch > + var i; > + for (i = 0; i < object.length; i++) { This should be one line as: for (var i = 0; i < object.length; ++i) { > + } > + return elements; Please put a new line between these two lines. I would like Pavel to review this to make sure everything is covered. I've actually started working on this one, but chose different approach: I was filtering indexes on the frontend side by their type (don't think we need a dedicated method for that in the injectedscript). I did not upload the patch since I wanted to do a test for it first. Now that tests are there I can put it in. Sorry about the confusion. I should have assigned the bug to myself. Keishi, do you think my version makes sense? Created attachment 41389 [details]
patch with no changes to InjectedScript (and a test!)
(In reply to comment #3) > I've actually started working on this one, but chose different approach: I was > filtering indexes on the frontend side by their type (don't think we need a > dedicated method for that in the injectedscript). > > I did not upload the patch since I wanted to do a test for it first. Now that > tests are there I can put it in. Sorry about the confusion. I should have > assigned the bug to myself. Keishi, do you think my version makes sense? This makes sense to me. You also handle sparse arrays better. Comment on attachment 41389 [details] patch with no changes to InjectedScript (and a test!) > +console-format.html:15["test", "test2", undefined, undefined, "test4"] It would be nice to have a space or ": " seperator here. Like the CONSOLE MESSAGE version. > -function dumpMessages() > +window.dumpMessages = function(testController) These are equivlant. If it is a global function, I prefer the old version. > + for (var i = 0; i < messages.length; ++i) Why < here? I think < would work fine. > + result.push(messages[i].toMessageElement().textContent); Does this need .replace(/\u200b/g, "")? (In reply to comment #6) > (From update of attachment 41389 [details]) > > > +console-format.html:15["test", "test2", undefined, undefined, "test4"] > > It would be nice to have a space or ": " seperator here. Like the CONSOLE > MESSAGE version. > I'll need to add some universal dump code for console messages in another change. > > > -function dumpMessages() > > +window.dumpMessages = function(testController) > > These are equivlant. If it is a global function, I prefer the old version. Done. > > > > + for (var i = 0; i < messages.length; ++i) > > Why < here? I think < would work fine. > Done. > > > + result.push(messages[i].toMessageElement().textContent); > > Does this need .replace(/\u200b/g, "")? No, since it does render any expandable nodes. Committing to http://svn.webkit.org/repository/webkit/trunk ... M LayoutTests/ChangeLog M LayoutTests/inspector/console-dir.html M LayoutTests/inspector/console-dirxml.html M LayoutTests/inspector/console-format-expected.txt M LayoutTests/inspector/console-format.html M LayoutTests/inspector/console-tests.html M WebCore/ChangeLog M WebCore/inspector/InspectorDOMAgent.cpp (to trigger WebCore build) M WebCore/inspector/front-end/ConsoleView.js Committed r49762 |