Closed Bug 1174168 Opened 5 years ago Closed 5 years ago

protocol.js array type should also work with iterators

Categories

(DevTools :: General, defect)

41 Branch
defect
Not set

Tracking

(firefox38 unaffected, firefox38.0.5 unaffected, firefox39 unaffected, firefox40 unaffected, firefox41 fixed)

RESOLVED FIXED
Firefox 41
Tracking Status
firefox38 --- unaffected
firefox38.0.5 --- unaffected
firefox39 --- unaffected
firefox40 --- unaffected
firefox41 --- fixed

People

(Reporter: jlong, Assigned: tromey)

Details

Attachments

(1 file, 1 obsolete file)

https://hg.mozilla.org/mozilla-central/diff/157f93335ed1/toolkit/devtools/server/protocol.js#l1.12

The above change forced the array type in protocol.js to only with with array, instead of generic iterator, which broke valence. Let's be conservative and make it work with any iterator, in case something else depends on this.
Assignee: nobody → ttromey
Status: NEW → ASSIGNED
It would be nice to also document in protocol.js.md that array types can also serialize iterators, if we are going to support (and test) this behavior.
Attachment #8621626 - Flags: review?(jlong)
Comment on attachment 8621626 [details] [diff] [review]
treat iterators as arrays in protocol.js

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

Looks great, thanks!
Attachment #8621626 - Flags: review?(jlong) → review+
I needed to add 'v &&' to the condition, as sometimes v===null,
causing "in" to throw.
Attachment #8622443 - Flags: review+
Keywords: checkin-needed
Attachment #8621626 - Attachment is obsolete: true
https://hg.mozilla.org/mozilla-central/rev/f408cb696641
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 41
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.