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

You haven't tried, have you!?

Replies are listed 'Best First'.
Re: Re: Re: strip JS-comments
by diotalevi (Canon) on Jun 10, 2003 at 13:56 UTC

    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?)

        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