Closed Bug 830967 Opened 11 years ago Closed 11 years ago

Array.concat ignores sparse elements in 'this' value

Categories

(Core :: JavaScript Engine, defect)

Other Branch
x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla21

People

(Reporter: bhackett1024, Assigned: bhackett1024)

References

Details

Attachments

(1 file)

      No description provided.
Oh, hit return too fast.  See bug 827490 comments 30 and 31.  Array.concat tries to be fast when the 'this' value is an array and quickly copy its elements to the result and reuse its type, but after bug 827490 this optimization misfires and ignores sparse elements on the 'this' array.
Attached patch patchSplinter Review
Fix.  I checked the other callers of NewDenseCopiedArray and none have this problem.
Assignee: general → bhackett1024
Attachment #702491 - Flags: review?(wmccloskey)
Comment on attachment 702491 [details] [diff] [review]
patch

Review of attachment 702491 [details] [diff] [review]:
-----------------------------------------------------------------

Can you assert in NewDenseCopiedArray that !obj->isIndexed()?
Attachment #702491 - Flags: review?(wmccloskey) → review+
https://hg.mozilla.org/mozilla-central/rev/d65eefeb7eaf
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: