convert null values

Eugen.Konkov at aldec.com Eugen.Konkov at aldec.com
Thu Oct 11 23:46:08 PDT 2007


>We do not get any bugs about this at bugzilla.mozilla.org
That may be in WEB few people work with null values and there too few big applications ( are they exist at all? ) on client side
So people do not commit any bugs. 

Why other languages do not do so? There may be a good cause
I think that is:
if( null )  ==> false
but after convertation to string it is going to be TRUE. I think that is naturally wrong
if( null.toString() ) ==> true

Despite on ES1-3. Can any tell:
What value they expect after convertion null to string?
You expect TRUE or FALSE?
  ----- Original Message ----- 
  From: Brendan Eich 
  To: <Eugen.Konkov at aldec.com> 
  Cc: Es4-discuss at mozilla.org 
  Sent: Thursday, October 11, 2007 7:58 PM
  Subject: Re: convert null values


  On Oct 11, 2007, at 7:21 AM, <Eugen.Konkov at aldec.com> <Eugen.Konkov at aldec.com> wrote:


    When convert null to string it is better to return empty string then 'null' string;

    var a= null;
    var b= '';
    b= 'test' + a; //b == 'testnull'; EXPECTED: b == 'test'


  This is an incompatible change and there's no point in making it now.


  However much better this seems now, that ship sailed 12 years ago in Netscape 2 (beta). We do not get any bugs about this at bugzilla.mozilla.org, and I've never heard of it as a recurrent cause of real-world confusion and bugs, which might justify an incompatbile change, if there is no content on the crawlable web that depends on null => "null" and only content wishing null => "". So ES4 should remain compatible with ES1-3 here.


  /be


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.mozilla.org/pipermail/es-discuss/attachments/20071012/7dc5ef61/attachment-0002.html 


More information about the Es4-discuss mailing list