You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

45 lines
1.7 KiB

--- !ditz.rubyforge.org,2008-03-06/issue
title: array index enum primitive guaranteeing correct array index order (even for sparse arrays)
desc: |-
This primitive is needed e.g. for Array.prototype.forEach() which is required
to enumerate in ascending array index order, and needs to skip non-existent
elements.
For arrays with an array part, it's easy to just run through the array part.
For arrays without an array part we don't care about speed that much, but
looping for every possible index and checking whether it exists is still too
slow. On the other hand, the normal enumeration primitive does not guarantee
correct ordering when array part is missing.
This primitive can be added as a flag to the ordinary enumeration primitive.
The flag would enable sorting of the key list based on numerical value as a
post-step. The sorting algorithm can be optimized for the assumption that
keys are usually in almost correct order.
The primitive could also be used to fix JSON.stringify() PropertyList
handling; stringify() is also required to use ascending array index order
for PropertyList but does not currently do so.
type: :task
component: duk
release: v0.3
reporter: sva <sami.vaarala@iki.fi>
status: :closed
disposition: :fixed
creation_time: 2013-03-02 19:30:26.519339 Z
references: []
id: a28ade3e0769f104de4fc0f3ca3b75f123cf79df
log_events:
- - 2013-03-02 19:30:26.706507 Z
- sva <sami.vaarala@iki.fi>
- created
- ""
- - 2013-03-11 12:35:51.031749 Z
- sva <sami.vaarala@iki.fi>
- assigned to release v0.3 from v0.4
- ""
- - 2013-03-11 12:35:55.607784 Z
- sva <sami.vaarala@iki.fi>
- closed with disposition fixed
- ""