in reply to strip JS-comments

var foo = " // text ";

Replies are listed 'Best First'.
Re: Re: strip JS-comments
by Skeeve (Parson) on Jun 10, 2003 at 13:51 UTC
    You haven't tried, have you!?

      No, I took your text at its word. Your documentation is wrong?

        No. It isn't. But your " // text " is not a // but a string. So my script doesn't even notice there is a // inside the string.

        On the other hand; My script will fail given something like

        var.match(//);
        (is this legal JavaScript code?)