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)
Tracking
()
RESOLVED
INCOMPLETE
People
(Reporter: atte, Unassigned)
Details
Attachments
(1 file)
|
1.84 KB,
application/x-xpinstall
|
Details |
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.
| Reporter | ||
Comment 1•11 years ago
|
||
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())]);
Updated•11 years ago
|
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Comment 2•11 years ago
|
||
It looks to me like a problem with cross-compartment |for each|. Using 'of' works, btw:
print([x for (x of g.Iterator1())]);
Updated•11 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Updated•3 years ago
|
Severity: normal → S3
Comment 3•1 year ago
|
||
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.
Description
•