[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 08:27:56 PDT 2012


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





--- Comment #7 from sam <dsam2912 at gmail.com>  2012-04-25 08:27:55 PST ---
(In reply to comment #5)
> Here is why delete and simple undefined work differently:
> 
> > var a = [undefined, undefined, 3]; Object.keys(a);
> ["0", "1", "2"]
> 
> > var a = [1, 2, 3]; delete a[0]; delete a[1]; Object.keys(a);
> ["2"]
> 
> 
> Anyways, in addition to the fix in appendUndefined, you should then change the loop in the _printArray to ignore values that have type undefined:
> 
> for (var i = 0; i < properties.length; ++i) {
>     var property = properties[i];
>     var name = property.name;
>     if (!isNaN(name) >>>>>>>>>>&& property.value.type !== "undefined"<<<<<<<<<<<)
>         elements[name] = this._formatAsArrayEntry(property.value);
> }

ohh, thanks Pavel!, have uploaded the patch.

-- 
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