Closed Bug 890112 Opened 7 years ago Closed 7 years ago

[OS.File] DirectoryIterator should correctly implement iterator interface

Categories

(Toolkit :: OS.File, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla25

People

(Reporter: ttaubert, Assigned: ttaubert)

References

Details

Attachments

(1 file)

When running browser/base/content/test/newtab/browser_newtab_bug722273.js that calls SessionFile.wipe() I see the following error:

> JavaScript Error: "Uncaught asynchronous error: TypeError: iterator is not iterable at
>  0:02.06 task@resource:///modules/sessionstore/_SessionFile.jsm:363
>  0:02.06 TaskImpl_run@resource://gre/modules/Task.jsm:192
>  0:02.06 Handler.prototype.process@resource://gre/modules/Promise.jsm:500
>  0:02.06 @resource://gre/modules/Promise.jsm:282
>  0:02.06 " {file: "resource:///modules/sessionstore/_SessionFile.jsm" line: 128}]

DirectoryIterator does not correctly implement the iterator interface and the code thus fails to actually remove sessionstore.js backup files.
Summary: [OS.File] Serialize DirectoryIterator should correctly implement iterator interface → [OS.File] DirectoryIterator should correctly implement iterator interface
Comment on attachment 771109 [details] [diff] [review]
DirectoryIterator should correctly implement iterator interface

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

Looks good – keeping in mind that async DirectoryIterator in fact implements an infinite iterator of promises that can only be stopped with a |break| or as a side effect of calling |yield promise|.
Attachment #771109 - Flags: review?(dteller) → review+
https://hg.mozilla.org/mozilla-central/rev/c9d1b2ab2e17
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
You need to log in before you can comment on or make changes to this bug.