On Mon, May 23, 2011 at 11:32 AM, Bob Nystrom <[email protected]> wrote:
> Using "public" to refer to an instance property seems totally weird to me.
>>
>
> For what it's worth, I agree. I'd prefer var or instance. I've already
> seen at least one example of someone misinterpreting it and doing something
> like:
>
> class C {
> public someMethod() { ... }
> }
>
> Their intent was to define a method on C's prototype (like you usually do)
> and have it be publicly accessible (like they usually are), but the above
> syntax doesn't do that. It's, I believe, an error instead because you're
> trying to define a *per-instance* method and it doesn't allow per-instance
> initializers.
>
> I'm pretty sure most people reading the above code would not interpret it
> the way the proposal does.
>
Just to be clear, the current proposal reject this as an early syntax error.
It is only if we extend the public declarations to allow out-of-constructor
initializations that we would get into this specific trouble.
>
> - bob
>
>
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
>
>
--
Cheers,
--MarkM
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss