> Here's my take at an example of brittleness:
>
> var bar = 42;
>
> class foo {
> function zot () { return bar; }
> }
>
> ...
>
> class subfoo extends foo {
> var bar = 'oops!';
> }
>
> (new foo).zot() => 42
> (new myfoo).zot() => ?
In AS3, the reference to bar in the zot function would be bound to
this.bar so, even in the subclass, there is no ambiguity and both
cases would output 42. I assume that ES4 would follow this behaviour.
The fragility is more likely to be in the opposite situation, where a
method in a class intends to access a global variable, but the
superclass has declared it too.
Peter
_______________________________________________
Es4-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es4-discuss