[Webkit-unassigned] [Bug 82468] Deleting an array item causes it to appear as `undefined × 1` in the console

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Apr 25 07:20:47 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=82468





--- Comment #4 from sam <dsam2912 at gmail.com>  2012-04-25 07:20:44 PST ---
(In reply to comment #3)
> (From update of attachment 138780 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=138780&action=review
> 
> > Source/WebCore/inspector/front-end/ConsoleMessage.js:341
> > +            if (!element || element.textContent === "undefined")
> 
> This change does not address the bug. You should instead modify appendUndefined to not render "x 1" in case it is actually "1". The code was not handling the undefined as the first value. This also needs a test (see LayoutTests/inspector/console/console-format.html).

Thanks for review Pavel.

I have though of the same thing first. 
But then though of other cases as well while cross checking.

Following are some of the cases and their o/p with checking for render "x 1" in case it is actually "1" in appendUndefined.

1).var array = [0, 1, 2, 3]; delete array[0]; array;
[undefined, 1, 2, 3]

2).var array = [undefined, undefined]; array;
[undefined, undefined]
--- I guess this should be handled as undefined*2. 
It would happen as the undefined values gets missed in while going through array elements and its corresponding properties in the loop just below appendUndefined().
Since there is no delete here, all properties value are in order and there will be no cumulation for undefined.

3).var array = [undefined, undefined, 1, 2, 3]; delete array[2]; delete array[3] ;array;
[undefined, undefined, undefined × 2, 3]
--- Same here.


But I guess check for "1" should be in place as "undefined" is better than "undefined x 1".

Kindly suggest.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list