in reply to Re: Re: strip JS-comments
in thread strip JS-comments

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

Replies are listed 'Best First'.
Re: Re: Re: Re: strip JS-comments
by Skeeve (Parson) on Jun 10, 2003 at 14:02 UTC
    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?)

      No it's not legal according to M$IE 6.0 and 5.5. It returns a "Syntax error". So it seems empty regexes are not allowed and you are safe.

      Jenda
      Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
         -- Rick Osborne

      Edit by castaway: Closed small tag in signature