Closed Bug 1148539 Opened 11 years ago Closed 1 year ago

js generator loaded from js code module and looping over it has stopped working

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: atte, Unassigned)

Details

Attachments

(1 file)

Attached file example extension
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0 Iceweasel/36.0 Build ID: 20150226093115 Steps to reproduce: Attached example extension adds "test1" and "test2" to context menu. They both run the same code, but only test2 prints correct result: "result:1,2,3". test1 generator is loaded from js code module and test2 generator is in the same scope. Both work for me in ff36, but not in ff37 or nightly.
sfink provided also this test case in #jsapi: code = ` function Iterator1() { var list = [1, 2, 3]; for (var i = 0; i < list.length; i++) yield list[i]; } `; g = newGlobal(); g.eval(code); eval(code); print([x for each (x in Iterator1())]); print([x for each (x in g.Iterator1())]);
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
It looks to me like a problem with cross-compartment |for each|. Using 'of' works, btw: print([x for (x of g.Iterator1())]);
Status: UNCONFIRMED → NEW
Ever confirmed: true
Severity: normal → S3

Incomplete: use of non-standard generators.

Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: