SYNTAX BUG

Eugen.Konkov at aldec.com Eugen.Konkov at aldec.com
Tue Oct 16 05:34:20 PDT 2007


In the next line there is ambigious between RegEx and comment
str.match(//); 

FAILS:   syntax error
--------------------------
var str='a';
if( str.match(//) ) {
  alert( 'YES' );
  }
 else {
  alert( 'No' );
  }


OK:    alerts 'YES'
--------------------------
var str='a';
if( str.match(/a/) ) {
  alert( 'YES' );
  }
 else {
  alert( 'No' );
  }

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.mozilla.org/pipermail/es-discuss/attachments/20071016/412f16c4/attachment-0002.html 


More information about the Es4-discuss mailing list