Is it a bug in Ecmascript - /\S/.test(null) returns true ?

Posted by Lauri on Stack Overflow See other posts from Stack Overflow or by Lauri
Published on 2010-03-12T04:51:47Z Indexed on 2010/03/12 4:57 UTC
Read the original article Hit count: 194

Both in Actionscript3 and Javascript these statements give the same result:

/\S/.test(null) => true
/null/.test(null) => true
/m/.test(null) => false
/n/.test(null) => true

Seems that null value is converted into string "null" in this case.

Is this a known bug in Ecmascript or am I missing something?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about actionscript-3