Is the following code valid?
function test() {
return /\//.exec("\/");
}
alert(test());
It seems that many javascript minifiers (including jsmin at http://jscompress.com/) consider the "//" on the second line to be the start of a comment. I assume it's a bug in the "trivially" implemented minifiers, since all the browser implementations I tried run it without a problem. Try it on jsfiddle.
var q = "//";is valid.