Re: Question about joined function object of ECMA-262 3rd edition

2007-08-05 Thread Shijun He
Do you mean Flash 5 ActionScript implement joined function? I have downloaded flash 5, but this old software can't be installed on win xp... On 7/31/07, P T Withington <[EMAIL PROTECTED]> wrote: > Oh. Ha, ha. Now I understand a piece of code in our runtime that > did exactly that (since removed)

Re: Question about joined function object of ECMA-262 3rd edition

2007-08-05 Thread liorean
On 05/08/07, Shijun He <[EMAIL PROTECTED]> wrote: > I read your post again today. And I found the key point is the > definition of "Equated". Yeah, but my argument was flawed since the spec never actually says what I read out from it. > 13.1.1 > Both uses obtained their FunctionBody from the same

Re: Question about joined function object of ECMA-262 3rd edition

2007-08-05 Thread Shijun He
In my opinion, the optimisation such as closure prototype in the spidermonkey is enough and joined function optimisation is useless (and wrong). If the developer want reuse the same function object, they can write like this: function A() { ... } A.B = function (x) { return x * x; } On 8/1/07, B

Re: Question about joined function object of ECMA-262 3rd edition

2007-08-05 Thread Shijun He
I read your post again today. And I found the key point is the definition of "Equated". 13.1.1 Both uses obtained their FunctionBody from the same location in the source text of the same ECMAScript program. This source text consists of global code and any contained function codes according to the

Re: Question about joined function object of ECMA-262 3rd edition

2007-08-04 Thread liorean
On 04/08/07, Shijun He <[EMAIL PROTECTED]> wrote: > On 7/27/07, liorean <[EMAIL PROTECTED]> wrote: > > Functions with different scope may be joined, but only if the scope > > difference will lead to no externally observable difference. > > I would like to say my opinion again: though your words is

Re: Question about joined function object of ECMA-262 3rd edition

2007-08-04 Thread Shijun He
On 7/27/07, liorean <[EMAIL PROTECTED]> wrote: > Functions with different scope may be joined, but only if the scope > difference will lead to no externally observable difference. I would like to say my opinion again: though your words is very reasonable, and I believe that may be the original mea

Re: Question about joined function object of ECMA-262 3rd edition

2007-07-31 Thread Brendan Eich
On Jul 31, 2007, at 5:41 AM, P T Withington wrote: > 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 b

Re: Question about joined function object of ECMA-262 3rd edition

2007-07-31 Thread P T Withington
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

Re: Question about joined function object of ECMA-262 3rd edition

2007-07-31 Thread Lars T Hansen
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 t

Re: Question about joined function object of ECMA-262 3rd edition

2007-07-30 Thread P T Withington
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. :) ___ Es4-discuss mailing list Es4-discuss

Re: Question about joined function object of ECMA-262 3rd edition

2007-07-27 Thread liorean
> On 7/27/07, liorean <[EMAIL PROTECTED]> wrote: > > x()===y() may return false the same way x()===x() may return false. > > Functions in JavaScript may have side effects, and the same input > > doesn't necessarily give the same output in cosecutive uses of the > > function. On 27/07/07, Shijun He

Re: Question about joined function object of ECMA-262 3rd edition

2007-07-27 Thread Shijun He
On 7/27/07, liorean <[EMAIL PROTECTED]> wrote: > x()===y() may return false the same way x()===x() may return false. > Functions in JavaScript may have side effects, and the same input > doesn't necessarily give the same output in cosecutive uses of the > function. No, I don't mean side effect, an

Re: Question about joined function object of ECMA-262 3rd edition

2007-07-27 Thread liorean
On 26/07/07, Neil Mix <[EMAIL PROTECTED]> wrote: > Wait, am I following this correctly in that: [snip] > 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 cou

Re: Question about joined function object of ECMA-262 3rd edition

2007-07-26 Thread Shijun He
I also post the question in the google groups such as comp.lang.javascript and netscape.public.mozilla.jseng. One reponse from mozilla.dev.tech.js-engine: http://groups.google.com/group/mozilla.dev.tech.js-engine/browse_thread/thread/16e22c189c9ea5f6/5383179969284d97#5383179969284d97 Jason Orendo

Re: Question about joined function object of ECMA-262 3rd edition

2007-07-26 Thread Shijun He
On 7/27/07, Neil Mix <[EMAIL PROTECTED]> wrote: > 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 implementat

Re: Question about joined function object of ECMA-262 3rd edition

2007-07-26 Thread Neil Mix
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 tha

Re: Question about joined function object of ECMA-262 3rd edition

2007-07-26 Thread John Cowan
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

Re: Question about joined function object of ECMA-262 3rd edition

2007-07-26 Thread liorean
> Shijun He scripsit: > > function A() { > > function B(x) { return x*x } > > return B > > } > > > > var b1 = A(); > > var b2 = A(); > > > > Spec says: b1 and b2 can be joined, implementation may make b1 and > > b2 the same object because [[scope]] of them have no difference. > > > > Two call o

Re: Question about joined function object of ECMA-262 3rd edition

2007-07-26 Thread John Cowan
Shijun He scripsit: > function A() { > function B(x) { return x*x } > return B > } > > var b1 = A(); > var b2 = A(); > > Spec says: b1 and b2 can be joined, implementation may make b1 and > b2 the same object because [[scope]] of them have no difference. > > Two call of A() will produce a f

Question about joined function object of ECMA-262 3rd edition

2007-07-26 Thread Shijun He
Hi, all: First, I'm sorry because the question is mainly about es3 not es4, but I don't know other place to get a authority answer about my question. We are talking about closure in javascript, and we have some questions about ECMA-262 3rd edition: What is joined function object(ecma-262 13.1)? T