[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:35:54 PDT 2012


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





--- Comment #5 from Pavel Feldman <pfeldman at chromium.org>  2012-04-25 07:35:50 PST ---
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);
}

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