Chromium Code Reviews
DescriptionPrevent conflict between parameter names and local function names.
From section 9.2 (Formal Parameters) of the spec:
The formal parameter list of a function introduces a new scope known
as the function's formal parameter scope. The formal parameter
scope of a function f is enclosed in the scope where f is declared.
Therefore, if one of the function's parameters has the same name as
the function itself, that isn't a problem.
Previously, we would add a local function to its own formal parameter
scope before visiting it (to allow it to call itself recursively), and
then after visiting it we would add it to the scope of the enclosing
function (so that the enclosing function could call it).
The fix is to add the local function just to the scope of the
enclosing function, and to do it before visiting the local function so
that recursion still works.
BUG=dartbug.com/20074
R=brianwilkerson@google.com
Committed: https://code.google.com/p/dart/source/detail?r=41621
Patch Set 1 #
Messages
Total messages: 4 (1 generated)
|
||||||||||||||||||||||||||||||||||||||||||||||