Re: ECMAScript Harmony

2008-08-15 Thread Garrett Smith
On Wed, Aug 13, 2008 at 2:26 PM, Brendan Eich <[EMAIL PROTECTED]> wrote: > It's no secret that the JavaScript standards body, Ecma's Technical > Committee 39, has been split for over a year, with some members > favoring ES4, a major fourth edition to ECMA-262, and others > advocating ES3.1 based on

Re: How to escape implicit 'with (this)' of a method body

2008-08-01 Thread Garrett Smith
On Fri, Aug 1, 2008 at 1:03 PM, Maciej Stachowiak <[EMAIL PROTECTED]> wrote: > > On Jul 31, 2008, at 5:24 AM, Dave Herman wrote: > >>> We should take this problem seriously. ... >>> >>> Dynamic scope is very bad. >> >> Specifically: >> >> - Classes are supposed to provide integrity, but dynamic sco

Re: ES3.1 Object static methods rationale document

2008-07-18 Thread Garrett Smith
On Fri, Jul 18, 2008 at 2:02 PM, Allen Wirfs-Brock <[EMAIL PROTECTED]> wrote: >> -Original Message- >> From: [EMAIL PROTECTED] [mailto:es4-discuss- >> [EMAIL PROTECTED] On Behalf Of Garrett Smith >> Sent: Friday, July 18, 2008 12:28 PM > ... >> You&#

Re: ES3.1 Object static methods rationale document

2008-07-18 Thread Garrett Smith
On Fri, Jul 18, 2008 at 12:40 PM, John Resig <[EMAIL PROTECTED]> wrote: > >> You're prev response seems to have come from the discussion of >> Object.create. > > No? We've been discussing the viability of a new Object.extend() method to be > introduced in ES3.1. The title of the thread is "object

Re: ES3.1 Object static methods rationale document

2008-07-18 Thread Garrett Smith
On Wed, Jul 16, 2008 at 5:50 PM, Maciej Stachowiak <[EMAIL PROTECTED]> wrote: > > On Jul 16, 2008, at 4:10 PM, Allen Wirfs-Brock wrote: > [snip] > > 1) It seems like Object.clone as you have described it is not suitable > for the "mixin" type use case where an object gets properties/methods > from

Re: ES3.1 Object static methods rationale document

2008-07-18 Thread Garrett Smith
On Fri, Jul 18, 2008 at 10:56 AM, John Resig <[EMAIL PROTECTED]> wrote: > >> Not true. YAHOO.lang.extend uses prototypal inheritance. > > YAHOO.lang.extend is similar in name only - YAHOO.lang.augmentObject is the > one that's actually similar to the functionality used by other code bases. > You'

Re: ES3.1 Object static methods rationale document

2008-07-18 Thread Garrett Smith
On Fri, Jul 18, 2008 at 7:39 AM, Allen Wirfs-Brock <[EMAIL PROTECTED]> wrote: > John, > > Thanks for pulling together all the various versions of Object.extend. Not all. > It's useful to have them in one place. > > There are a couple of things you mentioned that I wanted to clarify. > > Neither O

Re: ES3.1 Object static methods rationale document

2008-07-17 Thread Garrett Smith
On Thu, Jul 17, 2008 at 8:37 AM, John Resig <[EMAIL PROTECTED]> wrote: > > I wanted to bring up some further evidence for the widespread use of an > extend() method. Here are the top 5 JavaScript libraries and their associated > versions of "Object.extend()": > > There are a couple points that a

Re: ES3.1 Object static methods rationale document

2008-07-16 Thread Garrett Smith
2008/7/15 Allen Wirfs-Brock <[EMAIL PROTECTED]>: > I've up loaded to the wiki a new document titled: "Proposed ECMAScript 3.1 > Static Object Functions: Use Cases and Rationale" > > A couple of questions for you: My first question: How does an ES3.1 "sealed" object relate to fixtures? __

Re: ES3.1 Object static methods rationale document

2008-07-16 Thread Garrett Smith
On Wed, Jul 16, 2008 at 1:41 PM, David Flanagan <[EMAIL PROTECTED]> wrote: > Brendan Eich wrote: >> > Frankly, though, I imagine that defining properties will be more common > than reflecting on them, and I don't see anything wrong with a long name > that explicitly describes the function: getProp

Re: ES3.1 Object static methods rationale document

2008-07-16 Thread Garrett Smith
On Wed, Jul 16, 2008 at 1:16 PM, Allen Wirfs-Brock <[EMAIL PROTECTED]> wrote: > -Original Message- > From: Brendan Eich [mailto:[EMAIL PROTECTED] > > Right now, the best I can come up with is that it should be a relatively > efficient way to test for the existence of a possibly inherited

Re: Proposed ES4 draft 2

2008-07-11 Thread Garrett Smith
2008/7/11 Jeff Dyer <[EMAIL PROTECTED]>: > These specs should be the basis for technical discussions of ES4 on > es4-discuss and at the July 23 Oslo meeting. > What about operators: &&= ||= ? Garrett > > Jd ___ Es4-discuss mailing list Es4-discu

Re: Newly revised Section 10 for ES3.1.

2008-07-09 Thread Garrett Smith
2008/7/9 Allen Wirfs-Brock <[EMAIL PROTECTED]>: > I've just finished reworking section 10 to better accommodate block scoped > function declarations and const statements. In the course of this I had to > make various decisions about the semantics. The primary purpose of this > message is to provid

Re: Side-effects of some Array methods ...

2008-06-27 Thread Garrett Smith
On Fri, Jun 27, 2008 at 3:57 PM, Brendan Eich <[EMAIL PROTECTED]> wrote: > On Jun 27, 2008, at 3:45 PM, Garrett Smith wrote: > >> to list -> > > I am not the one replying to sender only -- all of my replies to you have > cc'ed the list. I know. I had a mista

Fwd: Side-effects of some Array methods ...

2008-06-27 Thread Garrett Smith
to list -> On Fri, Jun 27, 2008 at 3:04 PM, Brendan Eich <[EMAIL PROTECTED]> wrote: > On Jun 27, 2008, at 2:07 PM, Garrett Smith wrote: > >> A program that called pop() on an object w/no length would know right >> away if it failed. > > Why do you say that? >

Fwd: Side-effects of some Array methods ...

2008-06-27 Thread Garrett Smith
Back to list -> On Fri, Jun 27, 2008 at 1:27 PM, Brendan Eich <[EMAIL PROTECTED]> wrote: > On Jun 27, 2008, at 6:51 AM, Pratap Lakshman (VJ#SDK) wrote: > >> The side effect is as follows: if "this" does not have a "length" >> property, it ends up getting one; if "this" does have a length >> proper

Re: More string indexing semantics issues

2008-06-25 Thread Garrett Smith
On Wed, Jun 25, 2008 at 1:49 PM, Maciej Stachowiak <[EMAIL PROTECTED]> wrote: > > On Jun 25, 2008, at 1:33 PM, Garrett Smith wrote: > >> On Wed, Jun 25, 2008 at 1:25 AM, Maciej Stachowiak <[EMAIL PROTECTED]> wrote: >>> >>> On Jun 24, 2008, at 11:45

Re: More string indexing semantics issues

2008-06-25 Thread Garrett Smith
On Wed, Jun 25, 2008 at 1:52 PM, Maciej Stachowiak <[EMAIL PROTECTED]> wrote: > > On Jun 25, 2008, at 9:37 AM, Allen Wirfs-Brock wrote: > >> Garrent: It's Garrett, BTW. > > I have not seen any reports of such problems. If it were common to put > random numeric properties on String objects, I expe

Re: More string indexing semantics issues

2008-06-24 Thread Garrett Smith
2008/6/24 Allen Wirfs-Brock <[EMAIL PROTECTED]>: > Assuming the string index semantics I defined in my previous message, what > should the effect of setting a numeric property on a string whose property > name is a valid character position into the string? > > > > For example: > >var s = new St

Re: ES3.1 Draft: 11 June 2008 version available

2008-06-14 Thread Garrett Smith
On Sat, Jun 14, 2008 at 10:49 PM, Maciej Stachowiak <[EMAIL PROTECTED]> wrote: > > On Jun 14, 2008, at 12:21 PM, Mark S. Miller wrote: > >> On Fri, Jun 13, 2008 at 2:44 PM, Mark Miller <[EMAIL PROTECTED]> >> wrote: >>> On Fri, Jun 13, 2008 at 11:20 AM, Lars Hansen <[EMAIL PROTECTED]> > Named func

Re: ES3.1 Draft: Array generics

2008-06-08 Thread Garrett Smith
On Sun, Jun 8, 2008 at 2:50 PM, Pratap Lakshman (VJ#SDK) <[EMAIL PROTECTED]> wrote: > Garrett, > I apologize. > I was not ignoring you. Yes, I am interested in feedback! OK, but you seem to have misunderstood me. > > The initial Array generics proposal did not include the thisObj param as it > w

Re: ES3.1 Draft: Array generics

2008-06-08 Thread Garrett Smith
On Sun, Jun 8, 2008 at 2:50 PM, Pratap Lakshman (VJ#SDK) <[EMAIL PROTECTED]> wrote: > Garrett, > I apologize. > I was not ignoring you. Yes, I am interested in feedback! > > The initial Array generics proposal did not include the thisObj param as it > was felt that it could open the door to some s

Fwd: ES3.1 Draft: Array generics

2008-06-08 Thread Garrett Smith
es from non-subscribers are automatically rejected. Please subscribe to the list first before attempting to post, or ensure that you are posting using the address you subscribed with. -- Forwarded message ------ From: "Garrett Smith" <[EMAIL PROTECTED]> To: "[EMA

Fwd: ES3.1 Draft: Array generics

2008-05-31 Thread Garrett Smith
fwd to list. On Sat, May 31, 2008 at 1:44 AM, Garrett Smith <[EMAIL PROTECTED]> wrote: > 2008/5/19 Pratap Lakshman (VJ#SDK) <[EMAIL PROTECTED]>: > It would be sufficient and more correct to say: "throw a TypeError" > rather than "throw a TypeError exception&q

Re: ES3.1 Draft: Array generics

2008-05-31 Thread Garrett Smith
2008/5/19 Pratap Lakshman (VJ#SDK) <[EMAIL PROTECTED]>: > I have uploaded to the wiki a draft proposal (link) for Array generics. > I have extracted the Array portion of the ES3 spec, added a rationale (with > hyperlinks) at the beginning, and made relevant changes to the included > section 15.4 te

Re: Proposed ES4 draft 1

2008-05-31 Thread Garrett Smith
Hello, Does anyone else hate PDF? I want to be able to link to, and discuss this. PDF does not allow me to do this. It is difficult to copy paste between pages. What is wrong with HTML? Garrett ___ Es4-discuss mailing list Es4-discuss@mozilla.org http

Re: ES4 draft: Object

2008-05-15 Thread Garrett Smith
That sore thumb propertyIsEnumerable. propertyIsEnumerable, as a setter, sets the DontEnum flag for the object's own property. A value of 'false' makes the prop not show up in - for in. propertyIsEnumerable, as a getter, gets the value of the negation of the DontEnum flag, and does not check the p

Re: Date Format?

2008-04-20 Thread Garrett Smith
2008/4/17 Adam Peller <[EMAIL PROTECTED]>: > > > Garrett wrote: > > > > Properly formatting dates, solution (1), in ES is a lot of work. > > > > Indeed it is. I can see you've invested considerable time and effort into this problem. > A couple of Javascript toolkits have taken a crack at this > p

Re: Date Format?

2008-04-17 Thread Garrett Smith
On Tue, Apr 1, 2008 at 1:36 AM, Robert Sayre <[EMAIL PROTECTED]> wrote: > 2008/3/31 Nathan de Vries <[EMAIL PROTECTED]>: > > > > Without being part of a standard such as ES4... > > It is a library problem. The ES4 language spec is not the place to fix > every standard library deficiency. > Tha

Re: ES4 draft: assert expression

2008-04-16 Thread Garrett Smith
Sometimes errors might happen outside of an assert. Then the developer would have to try to rely on other things, like Spidermonkey's error.lineNumber and error.stack, or even window.onerror, even though it is buggy. It would be useful to get more error detail for free (w/o having to predefine an

Re: Class method addition and replacement (was Re: AOP Compatibility)

2008-04-06 Thread Garrett Smith
On Thu, Apr 3, 2008 at 5:20 PM, Peter Hall <[EMAIL PROTECTED]> wrote: > If you want mutability, you can define methods as vars in the first place. > > class Foo { > > // can be modified on a per-instance basis > public var f : function (a:T):S = function (a:T):S { > return null; > } >

Re: Date Format?

2008-03-31 Thread Garrett Smith
2008/3/31 Nathan de Vries <[EMAIL PROTECTED]>: > On Tue, 2008-04-01 at 00:39 +0200, Igor Bukanov wrote: > > Date.prototype.toLocaleFormat(format) in SpiderMonkey provides access > > exactly to strftime functionality. > > As with prior discussion regarding PTC, being "in SpiderMonkey" is > relat

Re: complexity tax

2008-03-26 Thread Garrett Smith
On Wed, Mar 26, 2008 at 8:23 AM, Douglas Crockford <[EMAIL PROTECTED]> wrote: > Brendan Eich wrote: > > > And over-minimizing a language imposes a complexity tax on programmers > > using it. That is true. > > To decide whether to evolve JS or shrink it, you need only look at two > > things: 1

Re: ES4 draft: the global object

2008-03-25 Thread Garrett Smith
On Tue, Mar 25, 2008 at 8:13 AM, Erik Arvidsson <[EMAIL PROTECTED]> wrote: > > > > Take Object.prototype.eval, for example. Nobody uses that much > > anymore. If it's removed from Mozilla, probably some pages will break, > > but not that many. Most people know better than to use that. I'm > > surpr

Re: ES4 draft: the global object

2008-03-25 Thread Garrett Smith
better than to use that. I'm surprised it's been hanging around in for so long. Garrett > > > On Tue, Mar 25, 2008 at 07:12, Garrett Smith <[EMAIL PROTECTED]> wrote: > -- > erik ___ Es4-discuss mailing list Es4-dis

Re: ES4 draft: the global object

2008-03-25 Thread Garrett Smith
There are some global functions that I think should be deprecated and moved to a relevant class. encodeURIComponent et al have nothing to do with the Global object. Same with isNaN, isFinite. These should be deprecated and moved to the appropriate object. In the case of encodeURIComponent, that

Fwd: Array Generics and null

2008-03-24 Thread Garrett Smith
-- Forwarded message -- From: Garrett Smith <[EMAIL PROTECTED]> Date: Mon, Mar 24, 2008 at 11:27 AM Subject: Re: Array Generics and null To: Dean Edwards <[EMAIL PROTECTED]> On Mon, Mar 24, 2008 at 10:31 AM, Dean Edwards <[EMAIL PROTECTED]> wrote: > Mike S

Re: Array Generics and null

2008-03-23 Thread Garrett Smith
On Sun, Mar 23, 2008 at 11:53 AM, Mike Shaver <[EMAIL PROTECTED]> wrote: > On Sun, Mar 23, 2008 at 3:45 AM, Garrett Smith <[EMAIL PROTECTED]> wrote: > > I suspected that. It is the problem with Google Mail, which exhibited > > a bug in Firefox. > > Sorry, d

Re: Array Generics and null

2008-03-23 Thread Garrett Smith
On Sun, Mar 23, 2008 at 12:45 AM, Garrett Smith <[EMAIL PROTECTED]> wrote: > I suspected that. It is the problem with Google Mail, which exhibited > a bug in Firefox. > > Use case: > 0) hit reply > 1) click 'send' > 2) hit 'stop' > 3) click

Fwd: Array Generics and null

2008-03-23 Thread Garrett Smith
r distraction from my message. Garrett On Sun, Mar 23, 2008 at 12:06 AM, Dean Edwards <[EMAIL PROTECTED]> wrote: > I assume you didn't intend to send this just to me. > > I do that a lot too - click "reply" instead of "replay all". :-) > > -dean >

Re: Array Generics and null

2008-03-22 Thread Garrett Smith
On Sat, Mar 22, 2008 at 9:01 AM, John Resig <[EMAIL PROTECTED]> wrote: > Hello all - > > It seems like there could be a couple solutions: Objects that are not capable of running in an Array-generic should not be attempted to run. Would it make sense to use - like - for all the Array generics?

Fwd: ES4 Working Group meeting next week (Mt. View)

2008-03-21 Thread Garrett Smith
I know Brendan's a busy guy. Lars or anyone: Is this open to regular people? -- Forwarded message -- From: Garrett Smith <[EMAIL PROTECTED]> Date: Fri, Mar 21, 2008 at 12:10 AM Subject: Re: ES4 Working Group meeting next week (Mt. View) To: Brendan Eich <[EMAIL PR

Re: ES4 draft: Error classes

2008-03-20 Thread Garrett Smith
On Tue, Mar 18, 2008 at 12:05 PM, Lars Hansen <[EMAIL PROTECTED]> wrote: > > -Original Message- > > From: Garrett Smith [mailto:[EMAIL PROTECTED] > > Sent: 18. mars 2008 11:57 > > To: Lars Hansen > > Cc: es4-discuss Discuss > > Subject: Re: ES

Re: ES4 draft: Error classes

2008-03-18 Thread Garrett Smith
On Mon, Mar 17, 2008 at 12:11 PM, Lars Hansen <[EMAIL PROTECTED]> wrote: > (Didn't know who to follow up to so lamely following up to myself.) > > Straw proposal for debugging information and backtraces in > error objects. > > Issues to watch out for: > > * Security / privacy problems if debu

Re: ES4 draft: Function

2008-03-13 Thread Garrett Smith
It seems to me that a function is a callable object, not the other way around. As if a Function were an implementation of Callable, where callable was an interface. For programs to be concerned more with the object's capability -- what it can do -- not who constructed it. Considering how that wou

Re: ES4 draft: Function

2008-03-13 Thread Garrett Smith
Hi Dustin, Well it does, apparently it was called the "splat" operator, which (to me) sounds a better than "spread". I think it works like:- var args = [12, true]; new C(...args); function C( count, isSemiAnnual) { } - Maybe one of guys writing the specs can comment on that. It can be hacked

Re: Controlling DontEnum (was: ES4 draft: Object)

2008-03-11 Thread Garrett Smith
On Tue, Mar 11, 2008 at 8:32 PM, Kris Zyp <[EMAIL PROTECTED]> wrote: > >> I've read mention of the weirdness of the timing window between the > >> property definition and it's marking as non-enumerable. That combined > >> with the above observation makes me wonder if this should really be > >>

Re: ES4 draft: Object

2008-03-06 Thread Garrett Smith
On Wed, Mar 5, 2008 at 7:19 PM, Brendan Eich <[EMAIL PROTECTED]> wrote: > Hixie argued strongly on IRC today for something that does not > So, rather than add an ugly "dontenum" keyword that would be seldom > used, the group preferred a built-in method. But this may have been a > minor mistake.

Re: Date Format?

2008-03-03 Thread Garrett Smith
What is the recommended approach? Thank you, Garrett On Mon, Mar 3, 2008 at 10:56 PM, Lars Hansen <[EMAIL PROTECTED]> wrote: > > > -Original Message- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On Behalf Of Garrett Smith > > Sent: 4. mar

Date Format?

2008-03-03 Thread Garrett Smith
Will ES4 have a simple date formatter? ___ Es4-discuss mailing list Es4-discuss@mozilla.org https://mail.mozilla.org/listinfo/es4-discuss

Re: AOP Compatibility

2008-02-21 Thread Garrett Smith
On Thu, Feb 21, 2008 at 7:47 AM, Neil Mix <[EMAIL PROTECTED]> wrote: > Another thought: does ES4 provide enough introspection capability to > write proxy objects that wrap an immutable class instance? It seems > as though it should be possible to create a single class (with * > getter/setter fu

Re: Greedy triple-quoted string literals

2008-02-20 Thread Garrett Smith
On Feb 19, 2008 10:21 AM, liorean <[EMAIL PROTECTED]> wrote: > > On Feb 18, 2008 1:17 PM, liorean <[EMAIL PROTECTED]> wrote: > On 19/02/2008, Garrett Smith <[EMAIL PROTECTED]> wrote > > (o.f)(); // =>o > > > > This should be window. >

Function inside if statement?

2008-02-05 Thread Garrett Smith
if(a) { function b(){ } } A block can contain statements. A statement can't start with the function keyword. Mozilla's Core JavaScript guide explains that of |b| should be evaluated as a functionExpression, but this isn't right. Source: http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Re

Re: super.apply(this, arguments)

2007-12-20 Thread Garrett Smith
On Dec 20, 2007 11:29 AM, P T Withington <[EMAIL PROTECTED]> wrote: > Given that we already have a whacky syntax for calling the super > initializer (which I confess I had forgotten), why not allow apply > there? It's unambiguous there, since you are only allowed to call the > super initializer.

Re: Exception handling vs. hasNext()

2007-11-18 Thread Garrett Smith
On Nov 17, 2007 5:50 AM, Brendan Eich <[EMAIL PROTECTED]> wrote: > On Nov 16, 2007, at 5:30 PM, Garrett Smith wrote: > > > Which is better? > > > > var nodes : int; > > var widgetMap = Widget.instances; // a map. > > var it:Iterator = widgetMap.g

Exception handling vs. hasNext()

2007-11-16 Thread Garrett Smith
e thing > is harder to keep clean with a hasNext/next pattern. > > > On Nov 16, 2007 5:30 PM, Garrett Smith <[EMAIL PROTECTED]> wrote: > > Which is better? > > > > var nodes : int; > > var widgetMap = Widget.instances; // a map. > > var it:Iter

Exception handling vs. hasNext()

2007-11-16 Thread Garrett Smith
Which is better? var nodes : int; var widgetMap = Widget.instances; // a map. var it:Iterator = widgetMap.getKeys(); -- this: -- try { widgetMap.get(it.next()).hide(); } catch(Exception e) { if(e instanceof StopIteration) { } } -- or this: -- while(it.hasNext()) { widgetMap.get(it.

Re: ES3 quasi incompatibilities

2007-11-11 Thread Garrett Smith
On Nov 11, 2007 7:18 PM, Yuh-Ruey Chen <[EMAIL PROTECTED]> wrote: > Garrett Smith wrote: > > JavaScript does not provide basic functionality for unique collections. > > > > It's trivial to implement an efficient Set class even in ES3 (with > certain restrictio

InterType Declarations, Cross-Cutting - how to in ES4?

2007-11-11 Thread Garrett Smith
InterType Declarations InterType Declarations are a useful Iand popular) way of adding functionality to an object, usually to the prototype of a constructor. Lets say I have a class Widget that I want to borrow from: class Widget { private function Widget(){} static { getByNode : funct

Re: ES3 quasi incompatibilities

2007-11-11 Thread Garrett Smith
Function findDuplicate is more like "mark duplicates". The side effect is that it adds a __marker property to each object. As it stands, this function can not be called more than once. The second call might be passed a different array, but containing one of those objects that had the __marker left

.newApply() ?

2007-11-10 Thread Garrett Smith
I know it's too late for a proposal, but I keep wanting a couple of things for AOP stuff. One is a newApply Creational = { getByNode : function(el){ if(!this.hasOwnProperty("instances")) this.instances = {}; return this.instances.hasOwnProperty(el.id) && this.instances[el.id] ||

Re: Chris Wilson: What I think about ES4

2007-11-04 Thread Garrett Smith
On 11/4/07, liorean <[EMAIL PROTECTED]> wrote: > On 04/11/2007, Mitch Skinner <[EMAIL PROTECTED]> wrote: > > Nicolas Cannasse wrote: Just curious, but am I the only one having trouble posting replies to Chris' blog? I posted a response to his response and answered his question that he asked me; a

Re: Chris Wilson: What I think about ES4

2007-11-04 Thread Garrett Smith
On 11/4/07, liorean <[EMAIL PROTECTED]> wrote: > On 04/11/2007, Mitch Skinner <[EMAIL PROTECTED]> wrote: > > Nicolas Cannasse wrote: Just curious, but am I the only one having trouble posting replies to Chris' blog? I posted a response to his response and answered his question that he asked me; a

Re: Chris Wilson: What I think about ES4

2007-11-03 Thread Garrett Smith
On 11/3/07, Nicolas Cannasse <[EMAIL PROTECTED]> wrote: > After the heated debate, I took time to write my opinion on the subject, > for what it's worth : > Debate? Where? I didn't see any debate on Chris' blog. It looked more like something we could expect to see from American politicians; or a g

Re: Re: [TLUG]: ECMAScript ("Javascript") Version 4 - FALSE ALARM

2007-10-28 Thread Garrett Smith
On 10/28/07, Douglas Crockford <[EMAIL PROTECTED]> wrote: > Robert Sayre wrote: > > Fighting over the name is pointless. It's not a good name, and web > > developers call it "JavaScript". > > The name is exactly the point. A new language should have a new name. The > deltas > from ES3 to the propo

Re: [TLUG]: ECMAScript ("Javascript") Version 4 - FALSE ALARM

2007-10-27 Thread Garrett Smith
On 10/27/07, Dave Herman <[EMAIL PROTECTED]> wrote: > Mark, > > > The language is without doubt much larger than it was. Part of this is > driven by a desire to provide conveniences that in ES3 people are forced > to simulate, often at cost to both performance and clarity: classes via > prototypes,

Re: Object.prototype.clone

2007-10-22 Thread Garrett Smith
cloneObject( this ); // Error if this is window. // enumeration is partially broken in IE, this loop will sometimes fail for( var property in srcObj ) On 10/22/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I have clone objects like this: > //

Fwd: Drop JSON from the language?

2007-10-22 Thread Garrett Smith
On 10/12/07, Robert Sayre <[EMAIL PROTECTED]> wrote: > I think this feature might be better to add as a library. I'm working > on a patch for Mozilla that provides a native JSON implementation like > so: |new JSON()|. I had been basing the API on Bob's python simplejson > API, but it looks like Goo

Re: Object.prototype.clone

2007-10-21 Thread Garrett Smith
On 10/21/07, Kris Zyp <[EMAIL PROTECTED]> wrote: > >> http://javascript.crockford.com/prototypal.html > It is the act of creating a object that inherits from/delegates to the > provided object. Peter is suggesting sugar for one of the important > mechanisms in a prototypal language. I believe the "

Re: is ES4 getting too bloated?

2007-10-21 Thread Garrett Smith
more... http://dhtmlkitchen.com/learn/js/enumeration/conclusion.jsp On 10/21/07, Brendan Eich <[EMAIL PROTECTED]> wrote: > I know of two industry-scale implementations under way, in addition > to Mozilla's Tamarin project, and Michael O'Brien (mbedthis.com), all > implementing ES4 in the next six

Re: is ES4 getting too bloated?

2007-10-21 Thread Garrett Smith
(fwd to list - I clicked the wrong button again...) On 10/21/07, Brendan Eich <[EMAIL PROTECTED]> wrote: > I know of two industry-scale implementations under way, in addition > to Mozilla's Tamarin project, and Michael O'Brien (mbedthis.com), all > implementing ES4 in the next six to nine months.

Re: is ES4 getting too bloated?

2007-10-21 Thread Garrett Smith
On 10/21/07, Brendan Eich <[EMAIL PROTECTED]> wrote: > I know of two industry-scale implementations under way, in addition > to Mozilla's Tamarin project, and Michael O'Brien (mbedthis.com), all > implementing ES4 in the next six to nine months. There's no reason, > zero, apart from will to do some

Re: Object.prototype.clone

2007-10-21 Thread Garrett Smith
On 10/21/07, Peter Michaux <[EMAIL PROTECTED]> wrote: > Hi, > > Is there a plan for a "clone" function in ES4? > > Object.prototype.clone = function() { > function F() {} > F.prototype = o; > return new F(); > }; > > The earliest reference I have found to this function is a

Re: is ES4 getting too bloated?

2007-10-21 Thread Garrett Smith
On 10/21/07, Yuh-Ruey Chen <[EMAIL PROTECTED]> wrote: > Hey all, > > I've been watching ES4 development and occasionally contributing input, > and I have noticed a somewhat disturbing trend. ES4 is getting ever more > and more complex. > > I understand ES4 is a multi-paradigm language and so must b

Re: Type Checking?

2007-10-11 Thread Garrett Smith
On 10/11/07, Brendan Eich <[EMAIL PROTECTED]> wrote: > On Oct 11, 2007, at 8:02 PM, Garrett Smith wrote: > > >> If you want to apply or call a non-function > >> callable, use Function.apply(callable, thisp, argArray) or > >> Function.call(callable, thisp

Re: Type Checking?

2007-10-11 Thread Garrett Smith
Incomplete sentence > Microsoft often says that it is necessary to retain backwards > compatibility. I would hope they would [not continue on this path.] <-- EDIT. > ___ Es4-discuss mailing list Es4-discuss@mozilla.org https://mail.mozilla.org/listinfo/e

Re: Type Checking?

2007-10-11 Thread Garrett Smith
On 10/11/07, Brendan Eich <[EMAIL PROTECTED]> wrote: > On Oct 11, 2007, at 1:36 PM, Garrett Smith wrote: > > > On 10/10/07, Brendan Eich <[EMAIL PROTECTED]> wrote: > >> On Oct 10, 2007, at 3:53 PM, Garrett Smith wrote: > >>if (it is Callable) ... &g

Re: Type Checking?

2007-10-11 Thread Garrett Smith
On 10/10/07, Brendan Eich <[EMAIL PROTECTED]> wrote: > On Oct 10, 2007, at 3:53 PM, Garrett Smith wrote: > >if (it is Callable) ... > > > The |is| operator tests universal or Platonic type, which involves > shared, immutable type descriptors that do not vary acr

Re: Type Checking?

2007-10-10 Thread Garrett Smith
On 10/10/07, Brendan Eich <[EMAIL PROTECTED]> wrote: > On Oct 10, 2007, at 3:53 PM, Garrett Smith wrote: > > > Typechecking is a problem. > > > > typeof is limited and allows host objects to return anything. The > > problem is that some host objects return &qu

Type Checking?

2007-10-10 Thread Garrett Smith
Typechecking is a problem. typeof is limited and allows host objects to return anything. The problem is that some host objects return "function", for example, a NodeList in Safari. This is perfectly legal, according to the spec. Checking instanceof between frames doesn't work. var i = document.g

Re: New Feature to JS 1.7

2007-10-08 Thread Garrett Smith
On 10/8/07, Brendan Eich <[EMAIL PROTECTED]> wrote: > On Oct 7, 2007, at 11:41 PM, Garrett Smith wrote: > > >> I personally believe that the unsound, untestable/non-executable ES3 > >> spec is a rathole we should avoid. The errata (which are not complete > >>

Re: New Feature to JS 1.7

2007-10-07 Thread Garrett Smith
On 9/24/07, Brendan Eich <[EMAIL PROTECTED]> wrote: > On Sep 24, 2007, at 10:51 AM, Garrett Smith wrote: > > > http://wiki.ecmascript.org/doku.php?id=proposals:maintenance_of_es3 > > > > The docs for ES3 are gonna be updated? > > No commitment from the group

Re: isPropertyEnumerable is going to stay broken?

2007-09-24 Thread Garrett Smith
On 9/10/07, Brendan Eich <[EMAIL PROTECTED]> wrote: > On Sep 10, 2007, at 2:21 PM, Garrett Smith wrote: > > The fact that the method > > was called propertyIsEnumerable instead of isPropertyEnumerable is not > > great, but the way propertyIsEnumerable is designed is

Re: New Feature to JS 1.7

2007-09-24 Thread Garrett Smith
http://wiki.ecmascript.org/doku.php?id=proposals:maintenance_of_es3 The docs for ES3 are gonna be updated? Including some changes to the spec? On 9/24/07, Brendan Eich <[EMAIL PROTECTED]> wrote: > JS1.7 shipped in Firefox 2 and it is "done". This list is for discussion of > ECMA-262 Edition 4 (

Re: 13.2.2 [[Construct]], constructor, and [[Class]] (was __proto__)

2007-09-23 Thread Garrett Smith
On 9/23/07, Brendan Eich <[EMAIL PROTECTED]> wrote: > On Sep 23, 2007, at 12:22 PM, Garrett Smith wrote: > > >>> in no case is the value of (new function(){}).constructor Function. > >> > > It shouldn't be, but it is in OSX Ref Impl. (I di

Re: 13.2.2 [[Construct]], constructor, and [[Class]] (was __proto__)

2007-09-23 Thread Garrett Smith
On 9/23/07, liorean <[EMAIL PROTECTED]> wrote: > On 23/09/2007, Garrett Smith <[EMAIL PROTECTED]> wrote: > > Function objects get a non-enumerable constructor. > > function F(){}; > > F.constructor === Function; // true > > F.prototyp

Re: 13.2.2 [[Construct]], constructor, and [[Class]] (was __proto__)

2007-09-23 Thread Garrett Smith
On 9/23/07, liorean <[EMAIL PROTECTED]> wrote: > > > On 23/09/2007, Garrett Smith <[EMAIL PROTECTED]> wrote: > > >> 2. (new function(){}).constructor should be Function. > > > On Sep 23, 2007, at 8:59 AM, liorean wrote: > > > I agree. And in ES3 i

Re: 13.2.2 [[Construct]], constructor, and [[Class]] (was __proto__)

2007-09-23 Thread Garrett Smith
On 9/23/07, liorean <[EMAIL PROTECTED]> wrote: > > > On 22/09/2007, Garrett Smith <[EMAIL PROTECTED]> wrote: > > > > What I've found is that it's always giving wrong constructor property > > > > with inheritance chains. > > &

Re: 13.2.2 [[Construct]], constructor, and [[Class]] (was __proto__)

2007-09-23 Thread Garrett Smith
On 9/22/07, liorean <[EMAIL PROTECTED]> wrote: > On 22/09/2007, Garrett Smith <[EMAIL PROTECTED]> wrote: > > What I've found is that it's always giving wrong constructor property > > with inheritance chains. > > > > A <-- B <-- C >

Re: __proto__

2007-09-22 Thread Garrett Smith
On 9/11/07, Lars T Hansen <[EMAIL PROTECTED]> wrote: > On the one hand, __proto__ is another potential security hole, and it > prevents implementations from sharing prototype objects among multiple > documents -- the link may be read-only but the object isn't. Function > B called from function A w

ES3 Errata

2007-09-17 Thread Garrett Smith
I read through Waldemar Horwat's Errata and did not find it here: http://www.mozilla.org/js/language/E262-3-errata.html here's the spec, including errata: Every built-in function and every built-in constructor has the Function protot

Re: isPropertyEnumerable is going to stay broken?

2007-09-17 Thread Garrett Smith
ue to the nature of the scan (using the narcissus parser in the > browser), the scan was fairly slow. I can use a different approach and > cover more pages if there is more interest. If not, I'll let this rest here. > > > Brendan Eich wrote: > > On Sep 8, 2007, at 10:06 PM

Fwd: isPropertyEnumerable is going to stay broken?

2007-09-11 Thread Garrett Smith
(fwd to list)... On 9/10/07, Brendan Eich <[EMAIL PROTECTED]> wrote: > On Sep 10, 2007, at 2:41 PM, Neil Mix wrote: > > > I think this is what Garrett is referring to: > > > > js> function f() {} > > js> f.prototype.foo = "blah"; > > blah > > js> var x = new f(); > > js> print(x.propertyIsEnumerabl

Re: isPropertyEnumerable is going to stay broken?

2007-09-10 Thread Garrett Smith
On 9/10/07, Brendan Eich <[EMAIL PROTECTED]> wrote: > On Sep 10, 2007, at 2:21 PM, Garrett Smith wrote: > > > And my point was that it appears to duplicate functionality of > > hasOwnProperty in a differently named method. > > The two functions are different: >

Re: isPropertyEnumerable is going to stay broken?

2007-09-10 Thread Garrett Smith
On 9/10/07, Brendan Eich <[EMAIL PROTECTED]> wrote: > On Sep 10, 2007, at 1:28 PM, Garrett Smith wrote: > > > It's possible to crawl the prototype chain, true. I did not know some > > implementations crawl the __proto__ for propertyIsEnumerable. Which > > on

Re: isPropertyEnumerable is going to stay broken?

2007-09-09 Thread Garrett Smith
sorry, propertyIsEnumerable. On 9/8/07, Garrett Smith <[EMAIL PROTECTED]> wrote: > https://bugzilla.mozilla.org/show_bug.cgi?id=57048 > > In this bug, dated 2000, Brendan and David agreed that > isPropertyEnumerable should check the prototype chain. > > It should not

Re: URI Proposal

2007-09-09 Thread Garrett Smith
On 9/9/07, zwetan <[EMAIL PROTECTED]> wrote: > when you see the gazillion libraries out there, either for Ajax, > ActionScript, etc. > the main common pattern you can see is that people stick to their libs, > and do not agregate their findings in one unified library, > so in the case of a URI clas

isPropertyEnumerable is going to stay broken?

2007-09-08 Thread Garrett Smith
https://bugzilla.mozilla.org/show_bug.cgi?id=57048 In this bug, dated 2000, Brendan and David agreed that isPropertyEnumerable should check the prototype chain. It should not backwards compatibility, but such functionality in the language seems necessary. How to check enumerable attribute, includ

URI Proposal

2007-09-07 Thread Garrett Smith
I've decided to propose a URI class to deal with the handling of URIs that is so prevalent in Ajax apps and also in Flash and to a lesser extent, Adobe Reader. I propose this idea here because noticed that there are other places besides the web that can use it (Flash, Reader). A URI class could be

bound methods / functions

2007-09-06 Thread Garrett Smith
Why not bind prototype methods? "Instance methods are functions that are defined without the static attribute and inside a class definition. Instance methods are associated with an instance of the class they are defined in. Instance methods can override or implement inherited class or interface me

  1   2   >