Re: New private names proposal

2010-12-17 Thread David Herman
Let me make a gentle plea for not creating unnecessary controversy. Take a step back: we all seem to agree we would like to provide a more convenient and performant way to create private fields in objects. In terms of observable behavior in the runtime model, there aren't that many differences

Re: New private names proposal

2010-12-17 Thread Mark S. Miller
On Fri, Dec 17, 2010 at 10:06 AM, David Herman dher...@mozilla.com wrote: Let me make a gentle plea for not creating unnecessary controversy. Take a step back: we all seem to agree we would like to provide a more convenient and performant way to create private fields in objects. Yes. We

Question on + and type conversions

2010-12-17 Thread P T Withington
If I define an object with both valueOf and toString methods: var color = { valueOf: function () { return 0xff; } ,toString: function () { return 'red'; } } The rules of `+` result in: color + 1 = 16711681 color + '' = '16711680' This is because of: 11.6.1 The Addition

Re: Question on + and type conversions

2010-12-17 Thread Brendan Eich
On Dec 17, 2010, at 2:01 PM, P T Withington wrote: 11.6.1 The Addition operator(+) ... 7. If Type(lprim) is String or Type(rprim) is String, then a. Return the String that is the result of concatenating ToString(lprim) followed by ToString(rprim) ... Is it intentional that after

Re: New private names proposal

2010-12-17 Thread Brendan Eich
On Dec 16, 2010, at 9:11 PM, David-Sarah Hopwood wrote: I don't like the private names syntax. I think it obscures more than it helps usability, and losing the x[id] === x.id equivalence is a significant loss. Again, this equivalence has never held in JS for all possible characters in a