Implement Xrays to Iterators

NEW
Unassigned

Status

()

Core
XPConnect
3 years ago
9 months ago

People

(Reporter: Bobby Holley (parental leave - send mail for anything urgent), Unassigned)

Tracking

(Blocks: 2 bugs)

Firefox Tracking Flags

(Not tracked)

Details

Right now, we don't have any special Xray support for iterators, so they end up creating objects in the target scope. This is a problem for iterators that produce things like [key, value] pairs, because the resulting Array gets Xrayed, and our filtering policy for Arrays ends up denying access to elements in pair.

This means that the following:

for (let [key, value] of someMap.entries())

can return various degenerate values, depending on what's in the Map. We should probably just not return such entries from the iterator, and adjust the size() of the Map appropriately.
Blocks: 1173651
Blocks: 1155700
Tom, do you want to take a stab at this one too?
Flags: needinfo?(evilpies)
I looked into this before and it's definitely annoying. Currently the iterators don't have ProtoKeys. The behavior of skipping values that aren't Xray described in comment 0 definitely needs special code as well. I would help anyone who wants to try this, but I will probably not do this before summer.
Flags: needinfo?(evilpies)
You need to log in before you can comment on or make changes to this bug.