Closed Bug 486061 Opened 15 years ago Closed 15 years ago

Empty array elements in JavaScript

Categories

(Firefox :: General, defect)

3.0 Branch
x86
macOS
defect
Not set
minor

Tracking

()

RESOLVED DUPLICATE of bug 260106

People

(Reporter: dmitry, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-us) AppleWebKit/528.16 (KHTML, like Gecko) Version/4.0 Safari/528.16
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.8) Gecko/2009032608 Firefox/3.0.8

When you create arrays in JavaScript and skipping an element, the element should not be created according to ecma spec. Instead length should be increased.
That means (0 in [,1]) should be false

Reproducible: Always

Steps to Reproduce:
1. Type in address bar javascript:alert(1 in [,,,2])
2. Press Enter
3. It alerts "true". Should alert "false" (and does in any other browser)
Actual Results:  
"true"

Expected Results:  
"false"
Version: unspecified → 3.0 Branch
hmm, works on trunk
Tested on Windows XP, I see indeed the problem in Firefox 3 and older, but not anymore with the latest trunk build. I don't see the bug in Firefox 3.5. So there's a big chance that this is a fixed bug.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.