On 2007-07-31, at 07:52 EDT, Lars T Hansen wrote: > On 7/30/07, P T Withington <[EMAIL PROTECTED]> wrote: > >> So, what the spec meant to say is: If the compiler writer can think >> of an optimization that will save time or space and not break the >> semantics of Javascript, they are permitted to make that >> optimization. :) > > Joining is more sinister than that and several messages in this thread > have approached the problem from various angles. The worst of it is > that side effects on function objects are unpredictable, as Neil Mix > wrote earlier.
Indeed. I was suggesting that the spec was broken; that it meant to prescribe an optimization to avoid unnecessary closures, but that it got it wrong (perhaps because it overlooked the mutability of the function object itself?). Surely backwards compatibility should not trump correctness? You don't want to have to force users to contrive to create a closure just to be able to add properties to a function? Oh. Ha, ha. Now I understand a piece of code in our runtime that did exactly that (since removed). I think the test case you are looking for might be the SWF version 5 interpreter. _______________________________________________ Es4-discuss mailing list Es4-discuss@mozilla.org https://mail.mozilla.org/listinfo/es4-discuss