Wait, am I following this correctly in that:
function A() {
function B() {}
return B;
}
var x = A();
var y = A();
x.foo = 1;
y.foo = 2;
alert(x.foo + y.foo);
would show "3" in current compliant implementations, but
theoretically in the future an implementation could exist that would
show "4" and *still be compliant*? If I'm surmising correctly, then
that seems...buggy.
On Jul 26, 2007, at 4:33 PM, John Cowan wrote:
> liorean scripsit:
>
>> A could have any number of local variables, b1 and b2 could still be
>> joined. The important factor is that it doesn't use variables from
>> the
>> containing scope(s), so there is no observable difference.
>
> Yes, that is what I meant.
>
>> If any implementation would chose to do the joined objects behaviour,
>> are they not more likely to actually just use a reference to the same
>> function object instead of joining two different objects?
>
> Quite so; as I said, the difference between joined and being the same
> is irrelevant in this context, and indeed an internal detail of the
> implementation.
>
>> However, I think the compiler complexity added for implementing this
>> will give a negliable reduction in footprint, so most implementors
>> haven't found it worthwile to do it.
>
> So far. Eventually, someone will write an "ahead-of-time" compiler
> in the style of typical Lisp compilers, where such things matter.
>
> --
> My confusion is rapidly waxing John Cowan
> For XML Schema's too taxing: [EMAIL PROTECTED]
> I'd use DTDs http://www.ccil.org/~cowan
> If they had local trees --
> I think I best switch to RELAX NG.
> _______________________________________________
> Es4-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es4-discuss
_______________________________________________
Es4-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es4-discuss