Closed Bug 627859 Opened 9 years ago Closed 8 years ago

Use the standard placeholder-making function when re-scoping variable references in generator 'yield' expressions

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla8

People

(Reporter: jimb, Assigned: jimb)

References

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file, 1 obsolete file)

CompExprTransplanter::transplant does a bunch of bespoke pointer-fiddling
to take the free variable references in the 'yield' expression and re-scope
them within the comprehension tail clauses.

Bug 576847 corrected the way this code incorrectly constructed placeholders for function references, but it would also work to simply use the same placeholder construction function everybody else does.
CompExprTransplanter::transplant did a bunch of bespoke pointer-fiddling to
take the free variable references in the 'yield' expression and re-scope
them within the comprehension tail clauses. That code incorrectly
constructed placeholders for function references; this was fixed in bug 576847.

However, it would also work to simply use the same placeholder construction
function everybody else does. This patch makes it so.
Assignee: general → jimb
Refreshed and re-tested for current TM.
Attachment #505940 - Attachment is obsolete: true
Attachment #519746 - Flags: review?(brendan)
Comment on attachment 519746 [details] [diff] [review]
Use the standard placeholder-making function when re-scoping variable references in generator 'yield' expressions.

Sorry, thought I r+'ed this already a while ago.

/be
Attachment #519746 - Flags: review?(brendan) → review+
http://hg.mozilla.org/tracemonkey/rev/756abc094eb1

Adapted to latest sources.

Also, the original patch failed to correctly flatten the nested 'if's, and would move placeholders from outside the comprehension into the comprehension's lexdeps table. Added a test to catch this case, and fixed the problem.
Whiteboard: fixed-in-tracemonkey
Depends on: 668438
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla8
You need to log in before you can comment on or make changes to this bug.