mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 00:39:49 +00:00
More rearranging the deck chairs on the titanic.
According to the comments, only closures proper have free variables. Running tests support this. So let's move it into that branch. BUG= R=sigmund@google.com Review-Url: https://codereview.chromium.org/2951923002 .
This commit is contained in:
parent
53e01faa43
commit
a721f87f99
|
@ -223,13 +223,13 @@ class LocalsHandler {
|
||||||
enterScope(scopeData,
|
enterScope(scopeData,
|
||||||
forGenerativeConstructorBody: isGenerativeConstructorBody);
|
forGenerativeConstructorBody: isGenerativeConstructorBody);
|
||||||
|
|
||||||
// If the freeVariableMapping is not empty, then this function was a
|
|
||||||
// nested closure that captures variables. Redirect the captured
|
|
||||||
// variables to fields in the closure.
|
|
||||||
closureData.forEachFreeVariable((Local from, FieldEntity to) {
|
|
||||||
redirectElement(from, to);
|
|
||||||
});
|
|
||||||
if (closureData.isClosure) {
|
if (closureData.isClosure) {
|
||||||
|
// If the freeVariableMapping is not empty, then this function was a
|
||||||
|
// nested closure that captures variables. Redirect the captured
|
||||||
|
// variables to fields in the closure.
|
||||||
|
closureData.forEachFreeVariable((Local from, FieldEntity to) {
|
||||||
|
redirectElement(from, to);
|
||||||
|
});
|
||||||
// Inside closure redirect references to itself to [:this:].
|
// Inside closure redirect references to itself to [:this:].
|
||||||
HThis thisInstruction =
|
HThis thisInstruction =
|
||||||
new HThis(closureData.thisLocal, commonMasks.nonNullType);
|
new HThis(closureData.thisLocal, commonMasks.nonNullType);
|
||||||
|
|
Loading…
Reference in a new issue