This wasn't totally unexpected but seriously made me go WTF. It appears
that arguments to regexp.test are cast to a string. This was bad for me
since I was writing a js parser at the time and checking the argument to
see if it matched one of the reserved words. See the example below:-

if(/^(?:undefined|ok|wtf|js)$/.test(undefined)){
  alert('WTF');
} else {
   alert('NO WTF');
}

That's pretty much all I got but if you didn't go WTF then I apologise for
the wasted thread.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to