Scope rules

Michael O'Brien mob at mbedthis.com
Thu Feb 7 16:16:06 PST 2008


I'm trying to find the scope rules for constructor initializers and for 
function parameter default values.  If someone could point me to a 
document or clarify these that would be great.

I've read bits and pieces. For constructor initializers:

class Shape {
    function Shape():
       leftSide = rightSide
    {
    }

    function render(arg1 = expression) {
    }
}

In the constructor initializers, I presume the leftSide has a scope 
equal to just outside the constructor and the rightSide binds to inside 
the constructor. Is this right?

Also, can "this" be used in either right or left side?

For function default arguments, is the scope of the expression just 
outside the function?

Michael






More information about the Es4-discuss mailing list