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

2008-06-12 Thread André Rømcke
Hi, and thanks for any work on making ES3 better while we wait for ES4!


One thing I miss form the targeted additions part of the spec is:
function.bindEvent aka function.bindEventListener

The difference from function.bind is that binded arguments are appended
after instead of before the arguments when called.

Example code for function.bind and function.bindEvent (where arguments is
a true array):


function.bind = function()
{
// Binds arguments to a function, so when you call the returned
wrapper function,
// arguments are intact and arguments passed to the wrapper function
is appended.
// first argument is 'this' and the rest is arguments
var args = arguments, __fn = this, __object = args.shift();
return function(){ return __fn.apply(__object, args.concat(arguments))};
};

function.bindEvent = function()
{
// Same as bind, but prepends the arguments to the wrapper function
var args = arguments, __fn = this, __object = args.shift();
return function(){ return __fn.apply(__object, arguments.concat(args))};
};



http://wiki.ecmascript.org/doku.php?id=es3.1:targeted_additions_to_array_string_object_date

On Thu, June 12, 2008 2:01 am, Pratap Lakshman (VJ#SDK) wrote:
 I have uploaded to the wiki
 (linkhttp://wiki.ecmascript.org/doku.php?id=es3.1:es3.1_proposal_working_draft,
 see under Draft Specification) the current draft of the specification
 for ES3.1. This is in the form of in-place edits and markups to the ES3
 specification. Revision history is at the end of the document.

 pratap



-- 
Best Regards / Med vennlig hilsen
André Rømcke
System consultant  eZ Labs developer
eZ Systems Nordic
[EMAIL PROTECTED] | +47 21 53 69 13 | www.ez.no

___
Es4-discuss mailing list
Es4-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es4-discuss


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

2008-06-12 Thread Sam Ruby
I'm trying to understand the nature of the ES3.1 - ES4 subset
relationship that this committee has agreed to.

 p69 12.10.  Disallowing the with statement in strict mode breaks the
 ES3.1 - ES4 subset relationship (we've found no compelling reason to
 ban it).

How does having ES4 support *more* than ES3.1 supports break the
subset relationship?

- Sam Ruby
___
Es4-discuss mailing list
Es4-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es4-discuss


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

2008-06-12 Thread Maciej Stachowiak

On Jun 12, 2008, at 9:45 AM, Sam Ruby wrote:

 I'm trying to understand the nature of the ES3.1 - ES4 subset
 relationship that this committee has agreed to.

 p69 12.10.  Disallowing the with statement in strict mode breaks the
 ES3.1 - ES4 subset relationship (we've found no compelling reason to
 ban it).

 How does having ES4 support *more* than ES3.1 supports break the
 subset relationship?

Having ES3.1 strict mode forbid features that ES4 strict mode does not  
(but which are in both languages) feels like breaking the subset  
relationship to me. The reason is that program that is purely ES3 but  
has the strict mode pragma added could then be legal in one language  
but not the other, which seems problematic.

To the extent that strict mode limits ES3-with-pragma programs, I  
think it should impose the same limits in ES3.1 and ES4.

Regards,
Maciej

___
Es4-discuss mailing list
Es4-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es4-discuss


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

2008-06-12 Thread Lars Hansen
Fair question.  I don't recall that it has been spelled out carefully,
actually.  I'll take a stab at it in the morning.  (Also, the ES3 -
ES3.1 and ES3 - ES4 relationships are important.)  Any useful
definition will have to deal with bugfixes and security fixes (like
global type names being read-only under some circumstances in ES4).

--lars

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf 
 Of Sam Ruby
 Sent: 12. juni 2008 18:46
 To: Lars Hansen
 Cc: [EMAIL PROTECTED]; es4-discuss@mozilla.org
 Subject: Re: ES3.1 Draft: 11 June 2008 version available
 
 I'm trying to understand the nature of the ES3.1 - ES4 subset 
 relationship that this committee has agreed to.
 
  p69 12.10.  Disallowing the with statement in strict mode breaks the
  ES3.1 - ES4 subset relationship (we've found no compelling 
 reason to 
  ban it).
 
 How does having ES4 support *more* than ES3.1 supports break 
 the subset relationship?
 
 - Sam Ruby
 
___
Es4-discuss mailing list
Es4-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es4-discuss