Closed Bug 865489 Opened 12 years ago Closed 12 years ago

Cannot iterate Addon SDK-List with for..of

Categories

(Add-on SDK Graveyard :: General, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: flying-sheep, Assigned: zer0)

References

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:20.0) Gecko/20100101 Firefox/20.0 Build ID: 20130408200758 Steps to reproduce: i tried to do for (let window of require("sdk/windows").browserWindows) {...} Actual results: but it totally failed! it somehow blocked or directly returned, as statements after the loop couldn’t be reached the deprecated for each ... in still works, but it will soon not. now we’re in the stupid situation that we have a for each loop that will soon not exist anymore, and a for of loop that doesn’t work yet… and i don’t really want to fall back to C-style for loops if we have all this nice stuff. Expected results: maybe the addon SDK shouldn’t be as complicated. the following links show places where the cause of the issue can possibly be reconstructed from, but damn, that’s complicated! emitting methods, mixing in traits, … https://github.com/mozilla/addon-sdk/blob/master/lib/sdk/deprecated/list.js#L41 https://github.com/mozilla/addon-sdk/blob/master/lib/sdk/windows/firefox.js#L173
Priority: -- → P2
Summary: Cannot iterate Addon SDK-List with for..on → Cannot iterate Addon SDK-List with for..of
Blocks: 866733
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attachment #745224 - Flags: review?(rFobic)
Assignee: nobody → zer0
Blocks: 868507
Attachment #745224 - Flags: review?(rFobic) → review+
Commits pushed to master at https://github.com/mozilla/addon-sdk https://github.com/mozilla/addon-sdk/commit/ad7bbd9b117c014766ec3d07d47980ff0829c690 Bug 865489 - Cannot iterate Addon SDK-List with for..of Added `iterator` method to `List` (deprecated version too), so that our SDK list (`tabs`, `browserWindows`, etc) can be iterated with `for...of`. https://github.com/mozilla/addon-sdk/commit/49c08fc619907889821c8e14e3caa5634dde16fa Merge pull request #986 from ZER0/for-of/865489 fix Bug 865489 - Cannot iterate Addon SDK-List with for..of r=@gozala
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: