Chromium Code Reviews
DescriptionAllow self-referencing closures.
Example:
var f = fib(i) {
if (i < 2) return i;
return fib(i - 1) + fib(i - 2);
};
print(f(5)); // => 5
The only thing we need to do is make the element representing the current closure point to 'this' inside its body.
In the process I had to fix some other minor issues that were triggered by this change.
Committed: https://code.google.com/p/dart/source/detail?r=4183
Patch Set 1 #Patch Set 2 : Add test. #Patch Set 3 : Don't create a box for self-referencing closures. #Patch Set 4 : Revert last update to CL. #
Total comments: 14
Patch Set 5 : Address comments. #
Messages
Total messages: 3 (0 generated)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||